Close input stream after adding entry to jar in DevTools tests

Closes gh-11089
This commit is contained in:
Andy Wilkinson
2017-11-20 14:14:48 +00:00
parent 85dc89e1b4
commit 89d27e58d3

View File

@@ -72,7 +72,13 @@ public class JarFileRemoteApplicationLauncher extends RemoteApplicationLauncher
file.getAbsolutePath().substring(root.getAbsolutePath().length() + 1)
.replace("\\", "/") + (file.isDirectory() ? "/" : "")));
if (file.isFile()) {
StreamUtils.copy(new FileInputStream(file), output);
FileInputStream input = new FileInputStream(file);
try {
StreamUtils.copy(input, output);
}
finally {
input.close();
}
}
output.closeEntry();
}