mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-03 15:59:31 +00:00
Close input stream after adding entry to jar in DevTools tests
Closes gh-11089
This commit is contained in:
+7
-1
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user