Class ShrinkWrapResource

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

public class ShrinkWrapResource extends Object implements Resource
Author:
Arjan Tijms
  • Constructor Details

    • ShrinkWrapResource

      public ShrinkWrapResource(String resourcesPath, org.jboss.shrinkwrap.api.Archive<?> archive)
      Constructor.
      Parameters:
      resourcesPath - the resources path.
      archive - the archive.
    • ShrinkWrapResource

      public ShrinkWrapResource(String resourcesPath, org.jboss.shrinkwrap.api.Archive<?> archive, String resourceName)
      Constructor.
      Parameters:
      resourcesPath - the resources path.
      archive - the archive.
      resourceName - the resource name
    • ShrinkWrapResource

      public ShrinkWrapResource(org.jboss.shrinkwrap.api.Archive<?> archive)
      Constructor.
      Parameters:
      archive - the archive.
  • Method Details

    • getResource

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

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

      public InputStream getResourceAsStreamByLocation(String location)
      Get the resource as stream by location.
      Parameters:
      location - the location.
      Returns:
      the input stream
    • 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
    • getArchive

      public org.jboss.shrinkwrap.api.Archive<?> getArchive()
      Returns:
      the embedded archive that contains the actual data
    • getAllLocations

      public Stream<String> getAllLocations(org.jboss.shrinkwrap.api.Archive<?> archiveToGetFrom)
      Get all locations.
      Parameters:
      archiveToGetFrom - the archive to use.
      Returns:
      the stream of locations.
    • getName

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