cleanup uwe's unzip code
This commit is contained in:
parent
a839644826
commit
f312a4e30d
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue