java.lang.Object
cloud.piranha.resource.impl.DefaultResourceManager
- All Implemented Interfaces:
ResourceManager
The default ResourceManager.
- Author:
- Manfred Riem ([email protected])
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addResource
(Resource resource) Add resource.Returns all the locations for this resource manager.getResource
(String location) Get the resource URL.getResourceAsStream
(String location) Get the resource as a stream.Returns all the locations for this resource manager.getResources
(String location) Get the resources.boolean
Returns isAlsoTryLoadFromClass.void
setAlsoTryLoadFromClass
(boolean alsoTryLoadFromClass) Sets the alsoTryLoadFromClass flag
-
Constructor Details
-
DefaultResourceManager
public DefaultResourceManager()
-
-
Method Details
-
addResource
Add resource.- Specified by:
addResource
in interfaceResourceManager
- Parameters:
resource
- the resource.
-
getResource
Get the resource URL.- Specified by:
getResource
in interfaceResourceManager
- Parameters:
location
- the location.- Returns:
- the URL, or null if not found.
- Throws:
MalformedURLException
- when the location URL is malformed.
-
getResources
Get the resources.- Specified by:
getResources
in interfaceResourceManager
- Parameters:
location
- the location.- Returns:
- the collection with the resources.
- Throws:
MalformedURLException
- when the location URL is malformed.
-
getResourceAsStream
Get the resource as a stream.- Specified by:
getResourceAsStream
in interfaceResourceManager
- Parameters:
location
- the location.- Returns:
- the input stream, or null if not found.
-
getAllLocations
Description copied from interface:ResourceManager
Returns all the locations for this resource manager.- Specified by:
getAllLocations
in interfaceResourceManager
- Returns:
- all the locations for this resource manager
-
getResourceList
Description copied from interface:ResourceManager
Returns all the locations for this resource manager.- Specified by:
getResourceList
in interfaceResourceManager
- Returns:
- all the locations for this resource manager
-
isAlsoTryLoadFromClass
public boolean isAlsoTryLoadFromClass()Description copied from interface:ResourceManager
Returns isAlsoTryLoadFromClass.- Specified by:
isAlsoTryLoadFromClass
in interfaceResourceManager
- Returns:
- isAlsoTryLoadFromClass
-
setAlsoTryLoadFromClass
public void setAlsoTryLoadFromClass(boolean alsoTryLoadFromClass) Description copied from interface:ResourceManager
Sets the alsoTryLoadFromClass flag- Specified by:
setAlsoTryLoadFromClass
in interfaceResourceManager
- Parameters:
alsoTryLoadFromClass
- the alsoTryLoadFromClass flag
-