java.lang.Object
cloud.piranha.resource.AliasedDirectoryResource
- All Implemented Interfaces:
Resource
public class AliasedDirectoryResource extends java.lang.Object implements Resource
The default AliasedDirectoryResource.
- Author:
- Manfred Riem ([email protected])
-
Constructor Summary
Constructors Constructor Description AliasedDirectoryResource()
Constructor.AliasedDirectoryResource(java.io.File rootDirectory, java.lang.String alias)
Constructor. -
Method Summary
Modifier and Type Method Description java.lang.String
getAlias()
Get the alias.java.util.stream.Stream<java.lang.String>
getAllLocations()
Get all the locations for this resource.java.net.URL
getResource(java.lang.String location)
Get the resource.java.io.InputStream
getResourceAsStream(java.lang.String location)
Get the resource as a stream.java.io.File
getRootDirectory()
Get the root directory.void
setAlias(java.lang.String alias)
Set the alias.void
setRootDirectory(java.io.File rootDirectory)
Set the root directory.
-
Constructor Details
-
AliasedDirectoryResource
public AliasedDirectoryResource()Constructor. -
AliasedDirectoryResource
public AliasedDirectoryResource(java.io.File rootDirectory, java.lang.String alias)Constructor.- Parameters:
rootDirectory
- the root directory.alias
- the alias.
-
-
Method Details
-
getResource
public java.net.URL getResource(java.lang.String location)Description copied from interface:Resource
Get the resource.- Specified by:
getResource
in interfaceResource
- Parameters:
location
- the location.- Returns:
- the URL.
-
getResourceAsStream
public java.io.InputStream getResourceAsStream(java.lang.String location)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:
Resource.getResourceAsStream(java.lang.String)
-
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 interfaceResource
- Returns:
- all the locations for this resource.
-
getAlias
public java.lang.String getAlias()Get the alias.- Returns:
- the alias.
-
getRootDirectory
public java.io.File getRootDirectory()Get the root directory.- Returns:
- the root directory.
-
setAlias
public void setAlias(java.lang.String alias)Set the alias.- Parameters:
alias
- the alias.
-
setRootDirectory
public void setRootDirectory(java.io.File rootDirectory)Set the root directory.- Parameters:
rootDirectory
- the root directory.
-