Class PathTreeWithManifest

java.lang.Object
io.quarkus.paths.PathTreeWithManifest
All Implemented Interfaces:
PathTree
Direct Known Subclasses:
ArchivePathTree, OpenContainerPathTree

public abstract class PathTreeWithManifest extends Object implements PathTree
  • Field Details

    • JAVA_VERSION

      public static final int JAVA_VERSION
      The feature-release version of the current Java runtime (e.g., 17, 21). Used to determine which META-INF/versions/<N> entries apply when resolving multi-release JAR resources.
    • manifestEnabled

      protected boolean manifestEnabled
    • manifestInitialized

      protected transient boolean manifestInitialized
    • multiReleaseMapping

      protected volatile Map<String,String> multiReleaseMapping
  • Constructor Details

    • PathTreeWithManifest

      protected PathTreeWithManifest()
    • PathTreeWithManifest

      protected PathTreeWithManifest(boolean manifestEnabled)
    • PathTreeWithManifest

      protected PathTreeWithManifest(PathTreeWithManifest pathTreeWithManifest)
  • Method Details

    • apply

      public <T> T apply(String resourceName, Function<PathVisit,T> func)
      Description copied from interface: PathTree
      Applies a function to a given resource in the tree. If the resource isn't found in the tree, the PathVisit argument passed to the function will be null.
      Specified by:
      apply in interface PathTree
      Type Parameters:
      T - resulting type
      Parameters:
      resourceName - resource to process
      func - processing function
      Returns:
      result of the function
    • apply

      protected abstract <T> T apply(String resourceName, Function<PathVisit,T> func, boolean manifestEnabled)
    • getManifestAttributes

      public ManifestAttributes getManifestAttributes()
      Description copied from interface: PathTree
      If META-INF/MANIFEST.MF found, reads it and returns an instance of ManifestAttributes, a trimmed down version of the Manifest, otherwise returns null.
      Specified by:
      getManifestAttributes in interface PathTree
      Returns:
      parsed META-INF/MANIFEST.MF if it's found, otherwise null
    • initManifest

      protected void initManifest(Manifest m)
    • manifestWriteLock

      protected ReentrantReadWriteLock.WriteLock manifestWriteLock()
    • manifestReadLock

      protected ReentrantReadWriteLock.ReadLock manifestReadLock()
    • isMultiReleaseJar

      public boolean isMultiReleaseJar()
    • getMultiReleaseMapping

      protected Map<String,String> getMultiReleaseMapping()
      Returns a mapping of classpath resource names to the corresponding version-specific resource names for resources found under META-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 from com/example/Foo.class to META-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_VERSION takes 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

      protected void initMultiReleaseMapping(Map<String,String> mrMapping)
    • toMultiReleaseResourceName

      protected String toMultiReleaseResourceName(String resourceName)