Class PrefixJarResource

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

public class PrefixJarResource extends Object implements Resource
The default PrefixJarResource.
Author:
Manfred Riem ([email protected])
  • Constructor Details

    • PrefixJarResource

      public PrefixJarResource()
      Constructor.
    • PrefixJarResource

      public PrefixJarResource(JarFile jarFile, String prefix)
      Constructor.
      Parameters:
      jarFile - the JAR file.
      prefix - the prefix.
  • Method Details

    • getResource

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

      public InputStream getResourceAsStream(String location)
      Get the resource as a stream.
      Specified by:
      getResourceAsStream in interface Resource
      Parameters:
      location - the resource location.
      Returns:
      the input stream, or null if not found.
      See Also:
      Resource.getResourceAsStream(java.lang.String)
    • 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
    • getJarFile

      public JarFile getJarFile()
      Returns the JAR file.
      Returns:
      the JAR file
    • getPrefix

      public String getPrefix()
      Returns the prefix.
      Returns:
      the prefix
    • setJarFile

      public void setJarFile(JarFile jarFile)
      Set the JAR file.
      Parameters:
      jarFile - the JAR file.
    • setPrefix

      public void setPrefix(String prefix)
      Set the prefix.
      Parameters:
      prefix - the prefix.
    • getName

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