From 6dd61509ce9925d701fe1589a2304ee07a848400 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Fri, 16 Aug 2024 14:09:29 +0200 Subject: [PATCH] Use the root path for OpenContainerPathTree#getRoots() The container path is the path of the container (could be a directory or an archive and shouldn't be used for browsing. The root path is the path of the root. In the case of an archive, it's actually a ZipPath, which can be used to browse the archive. Fixes #42571 --- .../src/main/java/io/quarkus/paths/OpenContainerPathTree.java | 2 +- .../app-model/src/main/java/io/quarkus/paths/PathTree.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/paths/OpenContainerPathTree.java b/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/paths/OpenContainerPathTree.java index ecdf1ba10e483..cada0ccbddc72 100644 --- a/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/paths/OpenContainerPathTree.java +++ b/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/paths/OpenContainerPathTree.java @@ -93,7 +93,7 @@ public OpenPathTree open() { @Override public Collection getRoots() { - return List.of(getContainerPath()); + return List.of(getRootPath()); } @Override 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 f8e4280b4f463..57dcafeda3a54 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 @@ -83,8 +83,7 @@ static PathTree ofArchive(Path archive, PathFilter filter) { /** * The roots of the path tree. *

- * Note that for archives, it will return the path to the archive itself, - * not a path that you can browse. + * Note that you shouldn't use these roots for browsing except if the PathTree is open. * * @return roots of the path tree */