Skip to content

Commit

Permalink
spotbugs
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Apr 27, 2022
1 parent 3aea495 commit 9de6521
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/org/wetator/backend/htmlunit/ResponseStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,17 @@ private void initOutputDir(final String aBrowserSubdir) {
}

private static void cleanDirectory(final File aDirectory) {
for (File tmpFile : aDirectory.listFiles()) {
if (tmpFile.isDirectory()) {
cleanDirectory(tmpFile);
}
final File[] tmpFiles = aDirectory.listFiles();
if (tmpFiles != null) {
for (File tmpFile : tmpFiles) {
if (tmpFile.isDirectory()) {
cleanDirectory(tmpFile);
}

tmpFile.delete();
if (!tmpFile.delete()) {
LOG.error("Can't delete file '" + FilenameUtils.normalize(tmpFile.getAbsolutePath()) + "'");
}
}
}
}

Expand Down

0 comments on commit 9de6521

Please sign in to comment.