Package io.quarkus.paths
Interface PathVisit
-
public interface PathVisitProvides context for a given path visit
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description PathgetPath()The path being visited.StringgetRelativePath(String separator)Path relative to the root of the tree as a string with a provided path element separator.PathgetRoot()The root of the path tree the current path belongs to.default URLgetUrl()URLthat can be used to read the content of the path.voidstopWalking()Terminates walking over aPathTreeafter this visit.
-
-
-
Method Detail
-
getRoot
Path getRoot()
The root of the path tree the current path belongs to. For aPathTreecreated for an archive, this will be the path to the archive file. For aPathTreecreated for a directory, this will be the path to the directory.- Returns:
- root of the path tree the current path belongs to
-
getPath
Path getPath()
The path being visited. TheFileSystemthe path belongs to will depend on the implementation of thePathTreebeing visited. For example, for an archive it will be a ZIPFileSystemimplementation. The returned path is granted to exist in the underlying file system (unless it was deleted by a parallel process or thread) and therefore it can be used for I/O operations straight away without further resolving, e.g. againstgetRoot()- Returns:
- path being visited
-
getUrl
default URL getUrl()
URLthat can be used to read the content of the path.- Returns:
- URL that can be used to read the content of the path
-
getRelativePath
String getRelativePath(String separator)
Path relative to the root of the tree as a string with a provided path element separator. For aPathTreecreated for an archive, the returned path will be relative to the root of the correspondingFileSystemimplementation. For aPathTreecreated for a directory, the returned path will be relative to the directory used as the root of the path tree.- Parameters:
separator- path element separator- Returns:
- path relative to the root of the tree as a string with a provided path element separator
-
stopWalking
void stopWalking()
Terminates walking over aPathTreeafter this visit.
-
-