Class ArchivePathTree.OpenArchivePathTree
- All Implemented Interfaces:
OpenPathTree,PathTree,Closeable,AutoCloseable
- Enclosing class:
ArchivePathTree
ReadOnlyZipFileSystem.
ReadOnlyZipFileSystem uses RandomAccessFile instead of
FileChannel, making it immune to the JDK issue (JDK-8316882) where an
interrupted thread closes the shared FileChannel (via
InterruptibleChannel), breaking the entire filesystem for all other threads.
Because RandomAccessFile is not interruptible, the thread's interrupt flag is
naturally preserved without explicit clearing or restoring.
-
Field Summary
Fields inherited from class io.quarkus.paths.OpenContainerPathTree
pathFilterFields inherited from class io.quarkus.paths.PathTreeWithManifest
JAVA_VERSION, manifestEnabled, manifestInitialized, multiReleaseMapping -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOpenArchivePathTree(io.quarkus.fs.util.rozip.ReadOnlyZipFileSystem fs) -
Method Summary
Modifier and TypeMethodDescriptionvoidConsumes a given resource from the tree.protected <T> Tvoidclose()booleanChecks whether the tree contains a resource.protected PathThis is the path to the container.Returns a set of resource names provided by this path tree.protected PathThis is the path to the container.protected voidprotected voidinitMultiReleaseMapping(Map<String, String> mrMapping) booleanWhether the content of this tree comes from an archive or not.booleanisOpen()protected ReentrantReadWriteLock.ReadLockreadLock()toString()voidwalk(PathVisitor visitor) Walks the tree.voidwalkIfContains(String resourceDirName, PathVisitor visitor) Walks a subtree of resources in this tree that begins with a passed inresourceDirName.voidwalkRaw(PathVisitor visitor) Walks the tree without remapping multi release content to the paths expected for the current Java version.protected ReentrantReadWriteLock.WriteLockMethods inherited from class io.quarkus.paths.OpenContainerPathTree
equals, getRoots, hashCode, openMethods inherited from class io.quarkus.paths.PathTreeWithManifest
apply, getManifestAttributes, getMultiReleaseMapping, isMultiReleaseJar, manifestReadLock, manifestWriteLock, toMultiReleaseResourceName
-
Constructor Details
-
OpenArchivePathTree
protected OpenArchivePathTree(io.quarkus.fs.util.rozip.ReadOnlyZipFileSystem fs)
-
-
Method Details
-
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.
-
getContainerPath
Description copied from class:OpenContainerPathTreeThis 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.
- Specified by:
getContainerPathin classOpenContainerPathTree
-
getRootPath
Description copied from class:OpenContainerPathTreeThis 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.
- Specified by:
getRootPathin classOpenContainerPathTree
-
readLock
-
writeLock
-
initManifest
- Overrides:
initManifestin classPathTreeWithManifest
-
initMultiReleaseMapping
- Overrides:
initMultiReleaseMappingin classPathTreeWithManifest
-
isOpen
public boolean isOpen() -
apply
- Overrides:
applyin classOpenContainerPathTree
-
accept
Description copied from interface:PathTreeConsumes a given resource from the tree. If the resource isn't found in the tree, thePathVisitargument passed to the consumer will benull.- Specified by:
acceptin interfacePathTree- Overrides:
acceptin classOpenContainerPathTree- Parameters:
resourceName- resource to consumeconsumer- path consumer
-
walk
Description copied from interface:PathTreeWalks the tree. This method will make sure the relevant multi release content is associated with the expected resource name paths for the current Java version.- Specified by:
walkin interfacePathTree- Overrides:
walkin classOpenContainerPathTree- Parameters:
visitor- path visitor
-
walkRaw
Description copied from interface:PathTreeWalks the tree without remapping multi release content to the paths expected for the current Java version.- Specified by:
walkRawin interfacePathTree- Overrides:
walkRawin classOpenContainerPathTree- Parameters:
visitor- path visitor
-
walkIfContains
Description copied from interface:PathTreeWalks a subtree of resources in this tree that begins with a passed inresourceDirName. If this tree does not contain resourceresourceDirNamethen the method returns without an error.This method does not create a new
PathTreewith the root atresourceDirName. It simply applies an inclusion filter to thisPathTreeinstance, keeping the same root.- Specified by:
walkIfContainsin interfacePathTree- Overrides:
walkIfContainsin classOpenContainerPathTree- Parameters:
resourceDirName- directory resource name starting from which the walk should beginvisitor- path visitor
-
getResourceNames
Description copied from interface:PathTreeReturns a set of resource names provided by this path tree. The set may include both directories and files.- Returns:
- a set of resource names provided by this path tree
-
contains
Description copied from interface:PathTreeChecks whether the tree contains a resource.- Specified by:
containsin interfacePathTree- Overrides:
containsin classOpenContainerPathTree- Parameters:
resourceName- resource name to check- Returns:
- true, in case the tree contains the path, otherwise - false
-
getPath
- Specified by:
getPathin interfaceOpenPathTree- Overrides:
getPathin classOpenContainerPathTree
-
close
- Throws:
IOException
-
getOriginalTree
-
toString
- Overrides:
toStringin classOpenContainerPathTree
-