diff --git a/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/paths/PathTree.java b/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/paths/PathTree.java index c0c40b85a6837..649a87c2eefcb 100644 --- a/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/paths/PathTree.java +++ b/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/paths/PathTree.java @@ -47,7 +47,8 @@ static PathTree ofDirectoryOrArchive(Path p, PathFilter filter) { try { final BasicFileAttributes fileAttributes = Files.readAttributes(p, BasicFileAttributes.class); return fileAttributes.isDirectory() ? new DirectoryPathTree(p, filter) - : ofArchive(p, filter); + // invoke ArchivePathTree.forPath directly instead of ofArchive() to avoid an extra Files.exists invocation + : ArchivePathTree.forPath(p, filter); } catch (IOException e) { throw new IllegalArgumentException(p + " does not exist", e); } @@ -76,7 +77,6 @@ static PathTree ofArchive(Path archive, PathFilter filter) { if (!Files.exists(archive)) { throw new IllegalArgumentException(archive + " does not exist"); } - return ArchivePathTree.forPath(archive, filter); }