Class ShrinkWrapResource
java.lang.Object
cloud.piranha.resource.shrinkwrap.ShrinkWrapResource
- All Implemented Interfaces:
Resource
- Author:
- Arjan Tijms
-
Constructor Summary
ConstructorDescriptionShrinkWrapResource(String resourcesPath, org.jboss.shrinkwrap.api.Archive<?> archive)
Constructor.ShrinkWrapResource(String resourcesPath, org.jboss.shrinkwrap.api.Archive<?> archive, String resourceName)
Constructor.ShrinkWrapResource(org.jboss.shrinkwrap.api.Archive<?> archive)
Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns all the locations for this resource.getAllLocations(org.jboss.shrinkwrap.api.Archive<?> archiveToGetFrom)
Get all locations.org.jboss.shrinkwrap.api.Archive<?>
getName()
Get the name of this resourcegetResource(String url)
Get the resource.getResourceAsStream(String url)
Get the resource as a stream.getResourceAsStreamByLocation(String location)
Get the resource as stream by location.
-
Constructor Details
-
ShrinkWrapResource
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
Description copied from interface:Resource
Get the resource.- Specified by:
getResource
in interfaceResource
- Parameters:
url
- the location.- Returns:
- the URL.
-
getResourceAsStream
Description copied from interface:Resource
Get the resource as a stream.- Specified by:
getResourceAsStream
in interfaceResource
- Parameters:
url
- the location.- Returns:
- the resource as a stream, or null if not found.
-
getResourceAsStreamByLocation
Get the resource as stream by location.- Parameters:
location
- the location.- Returns:
- the input stream
-
getAllLocations
Description copied from interface:Resource
Returns all the locations for this resource.- Specified by:
getAllLocations
in interfaceResource
- 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
Get all locations.- Parameters:
archiveToGetFrom
- the archive to use.- Returns:
- the stream of locations.
-
getName
Description copied from interface:Resource
Get the name of this resource
-