java.lang.Object
cloud.piranha.resource.impl.DirectoryResource
- All Implemented Interfaces:
Resource
The default DirectoryResource.
- Author:
- Manfred Riem ([email protected])
-
Constructor Summary
ConstructorDescriptionConstructor.DirectoryResource
(File rootDirectory) Constructor.DirectoryResource
(String rootDirectory) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns all the locations for this resource.getName()
Get the name of this resourcegetResource
(String location) Returns the resource.getResourceAsStream
(String location) Get the resource as a stream.Returns the root directory.void
setRootDirectory
(File rootDirectory) Set the root directory.toString()
-
Constructor Details
-
DirectoryResource
public DirectoryResource()Constructor. -
DirectoryResource
Constructor.- Parameters:
rootDirectory
- the root directory.
-
DirectoryResource
Constructor.- Parameters:
rootDirectory
- the root directory.
-
-
Method Details
-
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
-
getName
Description copied from interface:Resource
Get the name of this resource -
getResource
Returns the resource.- Specified by:
getResource
in interfaceResource
- Parameters:
location
- the location.- Returns:
- the resource
-
getResourceAsStream
Description copied from interface:Resource
Get the resource as a stream.- Specified by:
getResourceAsStream
in interfaceResource
- Parameters:
location
- the resource location.- Returns:
- the input stream, or null if not found.
- See Also:
-
getRootDirectory
Returns the root directory.- Returns:
- the root directory
-
setRootDirectory
Set the root directory.- Parameters:
rootDirectory
- the root directory.
-
toString
-