Package io.quarkus.paths
Class PathTreeWithManifest
java.lang.Object
io.quarkus.paths.PathTreeWithManifest
- All Implemented Interfaces:
PathTree
- Direct Known Subclasses:
ArchivePathTree,OpenContainerPathTree
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe feature-release version of the current Java runtime (e.g., 17, 21).protected booleanprotected boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedPathTreeWithManifest(boolean manifestEnabled) protectedPathTreeWithManifest(PathTreeWithManifest pathTreeWithManifest) -
Method Summary
Modifier and TypeMethodDescription<T> TApplies a function to a given resource in the tree.protected abstract <T> TIfMETA-INF/MANIFEST.MFfound, reads it and returns an instance ofManifestAttributes, a trimmed down version of the Manifest, otherwise returns null.Returns a mapping of classpath resource names to the corresponding version-specific resource names for resources found underMETA-INF/versions/in a multi-release JAR.protected voidprotected voidinitMultiReleaseMapping(Map<String, String> mrMapping) booleanprotected ReentrantReadWriteLock.ReadLockprotected ReentrantReadWriteLock.WriteLockprotected StringtoMultiReleaseResourceName(String resourceName) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.quarkus.paths.PathTree
accept, acceptAll, contains, filter, getResourceNames, getRoots, isArchiveOrigin, isEmpty, open, walk, walkIfContains, walkRaw
-
Field Details
-
JAVA_VERSION
public static final int JAVA_VERSIONThe feature-release version of the current Java runtime (e.g., 17, 21). Used to determine whichMETA-INF/versions/<N>entries apply when resolving multi-release JAR resources. -
manifestEnabled
protected boolean manifestEnabled -
manifestInitialized
protected transient boolean manifestInitialized -
multiReleaseMapping
-
-
Constructor Details
-
PathTreeWithManifest
protected PathTreeWithManifest() -
PathTreeWithManifest
protected PathTreeWithManifest(boolean manifestEnabled) -
PathTreeWithManifest
-
-
Method Details
-
apply
Description copied from interface:PathTreeApplies a function to a given resource in the tree. If the resource isn't found in the tree, thePathVisitargument passed to the function will benull. -
apply
-
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
-
initManifest
-
manifestWriteLock
-
manifestReadLock
-
isMultiReleaseJar
public boolean isMultiReleaseJar() -
getMultiReleaseMapping
Returns a mapping of classpath resource names to the corresponding version-specific resource names for resources found underMETA-INF/versions/in a multi-release JAR.For example, in a multi-release JAR containing
META-INF/versions/11/com/example/Foo.class, running on Java 11 or later would produce a mapping fromcom/example/Foo.classtoMETA-INF/versions/11/com/example/Foo.class.When multiple version-specific entries exist for the same resource, the highest version that does not exceed
JAVA_VERSIONtakes precedence.- Returns:
- a map from classpath resource names to their version-specific resource names, or an empty map if this is not a multi-release JAR
-
initMultiReleaseMapping
-
toMultiReleaseResourceName
-