git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15388 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2009-02-17 19:06:35 +00:00
1 parent fa76ba0d00
commit 39da96f605
1 file changed
+9 -5
+9 -5
View File
@@ -761,11 +761,15 @@ public final class FilePath implements Serializable {
final Pipe p = Pipe.createRemoteToLocal();
channel.callAsync(new Callable<Void,IOException>() {
public Void call() throws IOException {
FileInputStream fis = new FileInputStream(new File(remote));
Util.copyStream(fis,p.getOut());
fis.close();
p.getOut().close();
return null;
FileInputStream fis=null;
try {
fis = new FileInputStream(new File(remote));
Util.copyStream(fis,p.getOut());
return null;
} finally {
IOUtils.closeQuietly(fis);
IOUtils.closeQuietly(p.getOut());
}
}
});