Package io.quarkus.paths
Interface PathVisit
public interface PathVisit
Provides context for a given path visit
-
Method Summary
Modifier and TypeMethodDescriptiongetPath()The path being visited.default StringDeprecated, for removal: This API element is subject to removal in a future version.getRelativePath(String separator) Path relative to the root of the tree as a string with a provided path element separator.default StringVisited class path resource name.getRoot()The root of the path tree the current path belongs to.default URLgetUrl()URLthat can be used to read the content of the path.voidTerminates walking over aPathTreeafter this visit.
-
Method Details
-
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
URLthat can be used to read the content of the path.- Returns:
- URL that can be used to read the content of the path
-
getResourceName
Visited class path resource name.- Returns:
- visited resource name
-
getRelativePath
Deprecated, for removal: This API element is subject to removal in a future version.Path relative to the root of the tree as a string with/as a path element separator. This method callsgetRelativePath(String)passing/as an argument.- Returns:
- path relative to the root of the tree as a string with
/as a path element separator
-
getRelativePath
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.
-