Package org.onehippo.repository.util
Class FileContentResourceLoader
java.lang.Object
org.onehippo.repository.util.FileContentResourceLoader
- All Implemented Interfaces:
ContentResourceLoader
ContentResourceLoader
implementation for loading resources from a directory.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetResource
(String path) Returns a URL in file URL scheme.getResourceAsStream
(String path) Returns the resource located at the named path as anInputStream
object.
-
Constructor Details
-
FileContentResourceLoader
-
-
Method Details
-
getResource
Returns a URL in file URL scheme.- Specified by:
getResource
in interfaceContentResourceLoader
- Parameters:
path
- aString
specifying the path to the resource- Returns:
- the resource located at the named path,
or
null
if there is no resource at that path - Throws:
MalformedURLException
- if the pathname is not given in the correct form- See Also:
-
getResourceAsStream
Description copied from interface:ContentResourceLoader
Returns the resource located at the named path as anInputStream
object.The path must be specified according to the rules given in
getResource
. This method returnsnull
if no resource exists at the specified path.- Specified by:
getResourceAsStream
in interfaceContentResourceLoader
- Parameters:
path
- aString
specifying the path to the resource- Returns:
- the
InputStream
returned to the caller, ornull
if no resource exists at the specified path - Throws:
IOException
-