Optimize and close Zip resources in ClassicPluginStrategy and FilePath

This commit is contained in:
evernat committed 2013-08-27 00:03:09 +02:00
1 parent 3835b3fcc7
commit f5742df16b
2 files changed
+35 -25

No files matched your search

+6 -1
View File
@@ -527,7 +527,12 @@ public final class FilePath implements Serializable {
if (p != null) {
p.mkdirs();
}
IOUtils.copy(zip.getInputStream(e), f);
InputStream input = zip.getInputStream(e);
try {
IOUtils.copy(input, f);
} finally {
input.close();
}
try {
FilePath target = new FilePath(f);
int mode = e.getUnixMode();