Skip to content

Commit

Permalink
Cleanup temp folders
Browse files Browse the repository at this point in the history
  • Loading branch information
ediweissmann committed Jul 10, 2023
1 parent a675be6 commit bbf379a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sejda-model/src/main/java/org/sejda/model/util/IOUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@ public static File createTemporaryFolder() {
for (int counter = 0; counter < TEMP_DIR_ATTEMPTS; counter++) {
File tempDir = new File(baseDir, baseName + counter);
if (tempDir.mkdir()) {
tempDir.deleteOnExit();
return tempDir;
}
}

throw new IllegalStateException(
"Failed to create directory within " + TEMP_DIR_ATTEMPTS + " attempts (tried " + baseName + "0 to "
+ baseName + (TEMP_DIR_ATTEMPTS - 1) + ')');
Expand Down

0 comments on commit bbf379a

Please sign in to comment.