mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-04 23:55:52 +00:00
made more robust even when the file doesn't exist: http://www.nabble.com/stuck-on-InputStream-from-FilePath.read%28%29-td22053991.html
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15388 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
fa76ba0d00
commit
39da96f605
1 file changed
+9
-5
@@ -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());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user