From 6bd3928c7007da8002bd88f21d28f390efdc49cb Mon Sep 17 00:00:00 2001 From: Raluca Munteanu Date: Tue, 26 Apr 2016 12:17:55 +0000 Subject: [PATCH] Merged 5.1.N (5.1.2) to 5.2.N (5.2.1) 125591 mward: ACE-5052: close FileInputStream git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@125773 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../java/org/alfresco/filesys/repo/CommandExecutorImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/java/org/alfresco/filesys/repo/CommandExecutorImpl.java b/source/java/org/alfresco/filesys/repo/CommandExecutorImpl.java index 06bc9a90a2..6dfe125cc9 100644 --- a/source/java/org/alfresco/filesys/repo/CommandExecutorImpl.java +++ b/source/java/org/alfresco/filesys/repo/CommandExecutorImpl.java @@ -3,6 +3,7 @@ package org.alfresco.filesys.repo; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; import java.nio.channels.FileChannel; import java.util.List; @@ -286,10 +287,11 @@ public class CommandExecutorImpl implements CommandExecutor * find anything awry. * There are reported Windows JVM bugs such as 4715154 ... */ + FileOutputStream fos = new FileOutputStream(file); FileChannel outChan = null; try { - outChan = new FileOutputStream(file).getChannel(); + outChan = fos.getChannel(); outChan.truncate(0); } catch (IOException e) @@ -306,6 +308,7 @@ public class CommandExecutorImpl implements CommandExecutor } catch(IOException e){} } + fos.close(); } }