Skip to content

Commit

Permalink
fix bug in isEmpty method
Browse files Browse the repository at this point in the history
  • Loading branch information
thijslemmens committed Dec 4, 2023
1 parent ca0dc6b commit e6e3cdd
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ public Tomcat getTomcat() throws IOException {
}

protected boolean isEmptyDir(Path path) {
if (Files.isDirectory(path)) {
try (Stream<Path> entries = Files.list(path)) {
return entries.findFirst().isPresent();
} catch (IOException e) {
throw new RuntimeException(e);
}
if (!Files.isDirectory(path)) {
return false;
}

return false;
try (Stream<Path> entries = Files.list(path)) {
return !entries.findAny().isPresent();
} catch (IOException e) {
throw new RuntimeException(e);
}
}

private void addWebapp(Tomcat tomcat, Path path) {
Expand Down

0 comments on commit e6e3cdd

Please sign in to comment.