Package io.quarkus.paths
Class OpenContainerPathTree
java.lang.Object
io.quarkus.paths.PathTreeWithManifest
io.quarkus.paths.OpenContainerPathTree
- All Implemented Interfaces:
OpenPathTree
,PathTree
,Closeable
,AutoCloseable
- Direct Known Subclasses:
ArchivePathTree.OpenArchivePathTree
,DirectoryPathTree
-
Field Summary
FieldsFields inherited from class io.quarkus.paths.PathTreeWithManifest
JAVA_VERSION, manifestEnabled, manifestInitialized, multiReleaseMapping
-
Constructor Summary
ConstructorsModifierConstructorDescriptionFor deserialization of DirectoryPathTreeprotected
OpenContainerPathTree
(PathFilter pathFilter) protected
OpenContainerPathTree
(PathFilter pathFilter, boolean manifestEnabled) protected
OpenContainerPathTree
(PathFilter pathFilter, PathTreeWithManifest pathTreeWithManifest) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Consumes a given path relative to the root of the tree.protected <T> T
boolean
Checks whether the tree contains a relative path.boolean
protected abstract Path
This is the path to the container.protected abstract Path
This is the path to the container.getRoots()
The roots of the path tree.int
hashCode()
open()
Returns anOpenPathTree
for this tree, which is supposed to be closed at the end of processing.void
walk
(PathVisitor visitor) Walks the tree.void
walkIfContains
(String relativePath, PathVisitor visitor) Walks a subtree of this tree that begins with a passed inrelativePath
, if the tree containsrelativePath
.Methods inherited from class io.quarkus.paths.PathTreeWithManifest
apply, getManifestAttributes, getMultiReleaseMapping, initManifest, initMultiReleaseMapping, isMultiReleaseJar, manifestReadLock, manifestWriteLock, toMultiReleaseRelativePath
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.quarkus.paths.OpenPathTree
getOriginalTree, isOpen
Methods inherited from interface io.quarkus.paths.PathTree
acceptAll, apply, filter, getManifestAttributes, isArchiveOrigin, isEmpty
-
Field Details
-
pathFilter
-
-
Constructor Details
-
OpenContainerPathTree
public OpenContainerPathTree()For deserialization of DirectoryPathTree -
OpenContainerPathTree
-
OpenContainerPathTree
-
OpenContainerPathTree
-
-
Method Details
-
getContainerPath
This is the path to the container.In the case of a zip archive, it's the path of the archive. In the case of a directory, it's the directory.
Should only be used for equals/hashCode.
-
getRootPath
This is the path to the container.In the case of a zip archive, it's the path to the root of the archive (i.e. a ZipPath). In the case of a directory, it's the directory.
Should be used for any read operation on the container.
-
open
Description copied from interface:PathTree
Returns anOpenPathTree
for this tree, which is supposed to be closed at the end of processing. It is meant to be an optimization when processing multiple paths of path trees that represent archives. If a path tree does not represent an archive but a directory, for example, this method is expected to be a no-op, returning the original tree as an instance ofOpenPathTree
.- Specified by:
open
in interfacePathTree
- Returns:
- an instance of
OpenPathTree
for this path tree
-
getRoots
Description copied from interface:PathTree
The roots of the path tree.Note that you shouldn't use these roots for browsing except if the PathTree is open.
-
walk
Description copied from interface:PathTree
Walks the tree. -
walkIfContains
Description copied from interface:PathTree
Walks a subtree of this tree that begins with a passed inrelativePath
, if the tree containsrelativePath
. If the tree does not containrelativePath
then the method returns without an error.This method does not create a new
PathTree
with the root atrelativePath
. It simply applies an inclusion filter to thisPathTree
instance, keeping the same root.- Specified by:
walkIfContains
in interfacePathTree
- Parameters:
relativePath
- relative path from which the walk should beginvisitor
- path visitor
-
apply
- Specified by:
apply
in classPathTreeWithManifest
-
accept
Description copied from interface:PathTree
Consumes a given path relative to the root of the tree. If the path isn't found in the tree, thePathVisit
argument passed to the consumer will benull
. -
contains
Description copied from interface:PathTree
Checks whether the tree contains a relative path. -
getPath
- Specified by:
getPath
in interfaceOpenPathTree
-
hashCode
public int hashCode() -
equals
-