java.lang.Object
cloud.piranha.resource.impl.JarResource
- All Implemented Interfaces:
Resource
The default JarResource.
- Author:
- Manfred Riem ([email protected])
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns all the locations for this resource.Returns the JAR file.getName()
Get the name of this resourcegetResource
(String location) Returns the resource.getResourceAsStream
(String location) Get the resource as a stream.void
setJarFile
(File jarFile) Set the JAR file.toString()
-
Constructor Details
-
JarResource
public JarResource()Constructor. -
JarResource
Constructor.- Parameters:
jarFile
- the JAR file.
-
-
Method Details
-
getResource
Returns the resource.- Specified by:
getResource
in interfaceResource
- Parameters:
location
- the location.- Returns:
- the resource
-
getResourceAsStream
Get the resource as a stream.Note that this method will read the content of a JAR entry into a byte-array to avoid locking the JAR file.
- Specified by:
getResourceAsStream
in interfaceResource
- Parameters:
location
- the resource location.- Returns:
- the input stream, or null if not found.
- See Also:
-
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
-
getJarFile
Returns the JAR file.- Returns:
- the JAR file
-
setJarFile
Set the JAR file.- Parameters:
jarFile
- the JAR file.
-
getName
Description copied from interface:Resource
Get the name of this resource -
toString
-