Class MultiReleaseResource

java.lang.Object
cloud.piranha.resource.MultiReleaseResource
All Implemented Interfaces:
Resource

public final class MultiReleaseResource extends Object implements Resource
A resource wrapper that loads the versioned entries from META-INF/versions if the resource contains a main attribute named "Multi-Release" in the META-INF/MANIFEST.MF

A multi-release resource is a resource that contains a set of "base" entries and a set of "versioned" entries contained in subdirectories of "META-INF/versions" directory

The versioned entries are partitioned by the major version of the Java release. A versioned entry, with a version n, 8 < n, in the "META-INF/versions/{n}" directory overrides the base entry as well as any entry with a version number i where 8 < i < n

  • Constructor Details

    • MultiReleaseResource

      public MultiReleaseResource(Resource resource)
      Constructor
      Parameters:
      resource - the resource
  • Method Details

    • getResource

      public URL getResource(String location)
      Description copied from interface: Resource
      Get the resource.
      Specified by:
      getResource in interface Resource
      Parameters:
      location - the location.
      Returns:
      the URL.
    • getResourceAsStream

      public InputStream getResourceAsStream(String location)
      Description copied from interface: Resource
      Get the resource as a stream.
      Specified by:
      getResourceAsStream in interface Resource
      Parameters:
      location - the location.
      Returns:
      the resource as a stream, or null if not found.
    • getAllLocations

      public Stream<String> getAllLocations()
      Description copied from interface: Resource
      Returns all the locations for this resource.
      Specified by:
      getAllLocations in interface Resource
      Returns:
      all the locations for this resource
    • getName

      public String getName()
      Description copied from interface: Resource
      Get the name of this resource
      Specified by:
      getName in interface Resource
      Returns:
      the name