Skip to content

Commit

Permalink
Remove partial metadata archive if creation canceled.
Browse files Browse the repository at this point in the history
  • Loading branch information
brunchboy committed Apr 23, 2024
1 parent aa9a2ed commit 5020b1e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/org/deepsymmetry/cratedigger/Archivist.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ public void createArchive(Database database, File archiveFile, ArchiveListener l

++completed; // For use in providing progress feedback if there is a listener.
}

if (iterator.hasNext()) {
// We were canceled, so delete the partial archive.
Files.deleteIfExists(archivePath);
}
} catch (URISyntaxException e) {
Files.deleteIfExists(archivePath);
throw new IOException("Unable to create jar filesystem at file location", e);
Expand Down

0 comments on commit 5020b1e

Please sign in to comment.