Class ShrinkWrapResource

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

public class ShrinkWrapResource
extends java.lang.Object
implements Resource
Author:
Arjan Tijms
  • Constructor Summary

    Constructors
    Constructor Description
    ShrinkWrapResource​(java.lang.String resourcesPath, org.jboss.shrinkwrap.api.Archive<?> archive)
    Constructor.
    ShrinkWrapResource​(java.lang.String resourcesPath, org.jboss.shrinkwrap.api.Archive<?> archive, java.lang.String resourceName)
    Constructor.
    ShrinkWrapResource​(org.jboss.shrinkwrap.api.Archive<?> archive)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    java.util.stream.Stream<java.lang.String> getAllLocations()
    Get all the locations for this resource.
    java.util.stream.Stream<java.lang.String> getAllLocations​(org.jboss.shrinkwrap.api.Archive<?> archiveToGetFrom)
    Get all locations.
    org.jboss.shrinkwrap.api.Archive<?> getArchive()  
    java.lang.String getName()
    Get the name of this resource
    java.net.URL getResource​(java.lang.String url)
    Get the resource.
    java.io.InputStream getResourceAsStream​(java.lang.String url)
    Get the resource as a stream.
    java.io.InputStream getResourceAsStreamByLocation​(java.lang.String location)
    Get the resource as stream by location.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ShrinkWrapResource

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

      public ShrinkWrapResource​(java.lang.String resourcesPath, org.jboss.shrinkwrap.api.Archive<?> archive, java.lang.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 java.net.URL getResource​(java.lang.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 java.io.InputStream getResourceAsStream​(java.lang.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 java.io.InputStream getResourceAsStreamByLocation​(java.lang.String location)
      Get the resource as stream by location.
      Parameters:
      location - the location.
      Returns:
      the input stream
    • getAllLocations

      public java.util.stream.Stream<java.lang.String> getAllLocations()
      Description copied from interface: Resource
      Get 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 java.util.stream.Stream<java.lang.String> getAllLocations​(org.jboss.shrinkwrap.api.Archive<?> archiveToGetFrom)
      Get all locations.
      Parameters:
      archiveToGetFrom - the archive to use.
      Returns:
      the stream of locations.
    • getName

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