Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions src/main/java/io/github/eisop/website/EisopSiteGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,15 @@ public static void main(String[] args) throws IOException {
String assetName = String.valueOf(latestAssetsData.get("name"));
String assetBaseName = assetName.substring(0, assetName.length() - 4);
File unzippedFile = new File(assetBaseName);
try {
ZipFile zipFile = new ZipFile(fileTest);
// A zip that cannot be extracted must stop the run here, before the zip is moved into
// cf/: a zip in cf/ counts as published and is never extracted again.
try (ZipFile zipFile = new ZipFile(fileTest)) {
if (zipFile.isEncrypted()) {
throw new RuntimeException(
"Encountered an encrypted zip file, which was not expected.");
throw new IOException(
"Encountered an encrypted zip file, which was not expected: "
+ fileTest);
}
zipFile.extractAll(assetBaseName);
} catch (ZipException e) {
e.printStackTrace();
}

FileUtils.moveFileToDirectory(fileTest, directoryPath, false);
Expand All @@ -227,12 +227,9 @@ public static void main(String[] args) throws IOException {
if (releaseJavadoc.exists()) {
FileUtils.moveFileToDirectory(releaseJavadoc, javadocFolder, false);
File unzippedJavadoc = new File(javadocFolder, "checker-javadoc.jar");
try {
ZipFile zipFile = new ZipFile(unzippedJavadoc);
try (ZipFile zipFile = new ZipFile(unzippedJavadoc)) {
zipFile.extractAll(
new File(javadocFolder, "checker-javadoc").getAbsolutePath());
} catch (ZipException e) {
e.printStackTrace();
}
FileUtils.forceDelete(unzippedJavadoc);
}
Expand Down
Loading