consistency

This commit is contained in:
szymon 2020-12-14 12:56:36 +01:00
parent 09b809de8f
commit 927638e0b6

View File

@ -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);
}
} }
} }
} }