Skip to content

Commit

Permalink
Delete if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
algomaster99 committed Aug 16, 2023
1 parent 56349e6 commit 4809950
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions watchdog-agent/src/test/java/AgentTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ private static void recursiveDeleteOnShutdownHook(final Path path) {
@Override
public FileVisitResult visitFile(Path file, @SuppressWarnings("unused") BasicFileAttributes attrs)
throws IOException {
Files.delete(file);
Files.deleteIfExists(file);
return FileVisitResult.CONTINUE;
}

@Override
public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOException {
if (e == null) {
Files.delete(dir);
Files.deleteIfExists(dir);
return FileVisitResult.CONTINUE;
}
// directory iteration failed
Expand Down

0 comments on commit 4809950

Please sign in to comment.