Skip to content

Commit

Permalink
Use the root path for OpenContainerPathTree#getRoots()
Browse files Browse the repository at this point in the history
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

(cherry picked from commit 6dd6150)
  • Loading branch information
gsmet committed Aug 19, 2024
1 parent 2ff3b6c commit cb11e94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public OpenPathTree open() {

@Override
public Collection<Path> getRoots() {
return List.of(getContainerPath());
return List.of(getRootPath());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ static PathTree ofArchive(Path archive, PathFilter filter) {
/**
* The roots of the path tree.
* <p>
* 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
*/
Expand Down

0 comments on commit cb11e94

Please sign in to comment.