consistency
This commit is contained in:
parent
09b809de8f
commit
927638e0b6
@ -51,14 +51,15 @@ public class ZipDecompressor {
|
|||||||
} else {
|
} else {
|
||||||
File parent = file.getParentFile();
|
File parent = file.getParentFile();
|
||||||
|
|
||||||
if (!parent.isDirectory() && !parent.mkdirs())
|
if (!parent.isDirectory() && !parent.mkdirs()) {
|
||||||
throw new IOException("Failed to create directory " + parent);
|
Statics.LOGGER.error("Failed to create {}", parent);
|
||||||
|
} else {
|
||||||
try (OutputStream outputStream = Files.newOutputStream(file.toPath());
|
try (OutputStream outputStream = Files.newOutputStream(file.toPath());
|
||||||
BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(outputStream)) {
|
BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(outputStream)) {
|
||||||
IOUtils.copy(zipInputStream, bufferedOutputStream);
|
IOUtils.copy(zipInputStream, bufferedOutputStream);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Statics.LOGGER.error("An exception occurred while trying to decompress file: {}", file.getName(), e);
|
Statics.LOGGER.error("An exception occurred while trying to decompress file: {}", file.getName(), e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user