Package io.quarkus.paths
Class EmptyPathTree
java.lang.Object
io.quarkus.paths.EmptyPathTree
- All Implemented Interfaces:
OpenPathTree,PathTree,Closeable,AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConsumes a given path relative to the root of the tree.<T> TApplies a function to a given path relative to the root of the tree.voidclose()booleanChecks whether the tree contains a relative path.static EmptyPathTreeIfMETA-INF/MANIFEST.MFfound, reads it and returns an instance ofManifestAttributes, a trimmed down version of the Manifest, otherwise returns null.getRoots()The roots of the path tree.booleanWhether the content of this tree comes from an archive or not.booleanisOpen()open()Returns anOpenPathTreefor this tree, which is supposed to be closed at the end of processing.toString()voidwalk(PathVisitor visitor) Walks the tree.voidwalkIfContains(String relativePath, PathVisitor visitor) Walks a subtree of this tree that begins with a passed inrelativePath, if the tree containsrelativePath.
-
Constructor Details
-
EmptyPathTree
public EmptyPathTree()
-
-
Method Details
-
getInstance
-
isArchiveOrigin
public boolean isArchiveOrigin()Description copied from interface:PathTreeWhether the content of this tree comes from an archive or not.This is useful for instance when you want to determine if the resources can be updated in dev mode.
- Specified by:
isArchiveOriginin interfacePathTree
-
getRoots
Description copied from interface:PathTreeThe roots of the path tree.Note that you shouldn't use these roots for browsing except if the PathTree is open.
-
getManifestAttributes
Description copied from interface:PathTreeIfMETA-INF/MANIFEST.MFfound, reads it and returns an instance ofManifestAttributes, a trimmed down version of the Manifest, otherwise returns null.- Specified by:
getManifestAttributesin interfacePathTree- Returns:
- parsed
META-INF/MANIFEST.MFif it's found, otherwisenull
-
walk
Description copied from interface:PathTreeWalks the tree. -
walkIfContains
Description copied from interface:PathTreeWalks a subtree of this tree that begins with a passed inrelativePath, if the tree containsrelativePath. If the tree does not containrelativePaththen the method returns without an error.This method does not create a new
PathTreewith the root atrelativePath. It simply applies an inclusion filter to thisPathTreeinstance, keeping the same root.- Specified by:
walkIfContainsin interfacePathTree- Parameters:
relativePath- relative path from which the walk should beginvisitor- path visitor
-
apply
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
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
Description copied from interface:PathTreeChecks whether the tree contains a relative path. -
getPath
- Specified by:
getPathin interfaceOpenPathTree
-
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
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getOriginalTree
- Specified by:
getOriginalTreein interfaceOpenPathTree
-
toString
-