cleanup uwe's unzip code

This commit is contained in:
Robert Muir 2015-06-30 23:59:45 -04:00
parent a839644826
commit f312a4e30d
1 changed files with 6 additions and 6 deletions

View File

@ -313,13 +313,13 @@ public class PluginManager {
// be on the safe side: do not rely on that directories are always extracted // be on the safe side: do not rely on that directories are always extracted
// before their children (although this makes sense, but is it guaranteed?) // before their children (although this makes sense, but is it guaranteed?)
Files.createDirectories(targetFile.getParent()); Files.createDirectories(targetFile.getParent());
if (!entry.isDirectory()) { if (entry.isDirectory() == false) {
OutputStream out = Files.newOutputStream(targetFile); try (OutputStream out = Files.newOutputStream(targetFile)) {
int len; int len;
while((len = zipInput.read(buffer)) >= 0) { while((len = zipInput.read(buffer)) >= 0) {
out.write(buffer, 0, len); out.write(buffer, 0, len);
} }
out.close(); }
} }
zipInput.closeEntry(); zipInput.closeEntry();
} }