Package io.quarkus.paths
Class CachingPathTree
- java.lang.Object
-
- io.quarkus.paths.CachingPathTree
-
- All Implemented Interfaces:
OpenPathTree,PathTree,Closeable,AutoCloseable
public class CachingPathTree extends Object implements OpenPathTree
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(String relativePath, Consumer<PathVisit> func)Consumes a given path relative to the root of the tree.<T> Tapply(String relativePath, Function<PathVisit,T> func)Applies a function to a given path relative to the root of the tree.voidclose()booleancontains(String relativePath)Checks whether the tree contains a relative path.booleanequals(Object obj)ManifestgetManifest()IfMETA-INF/MANIFEST.MFfound, reads it and returns an instance ofManifest, otherwise returns null.PathTreegetOriginalTree()PathgetPath(String relativePath)Collection<Path>getRoots()The roots of the path tree.inthashCode()booleanisOpen()static CachingPathTreeof(PathTree pathTree)OpenPathTreeopen()Returns anOpenPathTreefor this tree, which is supposed to be closed at the end of processing.voidwalk(PathVisitor visitor)Walks the tree.
-
-
-
Method Detail
-
of
public static CachingPathTree of(PathTree pathTree)
-
getRoots
public Collection<Path> getRoots()
Description copied from interface:PathTreeThe roots of the path tree.
-
getManifest
public Manifest getManifest()
Description copied from interface:PathTreeIfMETA-INF/MANIFEST.MFfound, reads it and returns an instance ofManifest, otherwise returns null.- Specified by:
getManifestin interfacePathTree- Returns:
- parsed
META-INF/MANIFEST.MFif it's found, otherwisenull
-
walk
public void walk(PathVisitor visitor)
Description copied from interface:PathTreeWalks the tree.
-
apply
public <T> T apply(String relativePath, Function<PathVisit,T> func)
Description copied from interface:PathTreeApplies a function to a given path relative to the root of the tree. If the path isn't found in the tree, thePathVisitargument passed to the function will benull.
-
accept
public void accept(String relativePath, Consumer<PathVisit> func)
Description copied from interface:PathTreeConsumes a given path relative to the root of the tree. If the path isn't found in the tree, thePathVisitargument passed to the consumer will benull.
-
contains
public boolean contains(String relativePath)
Description copied from interface:PathTreeChecks whether the tree contains a relative path.
-
getPath
public Path getPath(String relativePath)
- Specified by:
getPathin interfaceOpenPathTree
-
open
public OpenPathTree open()
Description copied from interface:PathTreeReturns anOpenPathTreefor 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:
openin interfacePathTree- Returns:
- an instance of
OpenPathTreefor this path tree
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin interfaceOpenPathTree
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getOriginalTree
public PathTree getOriginalTree()
- Specified by:
getOriginalTreein interfaceOpenPathTree
-
-