Package org.onehippo.repository.xml
Interface ContentResourceLoader
- All Known Implementing Classes:
FileContentResourceLoader
,ZipFileContentResourceLoader
public interface ContentResourceLoader
Strategy interface for loading resources (e.g, file system resources, zip entry resources or URI based resources).
-
Method Summary
Modifier and TypeMethodDescriptiongetResource
(String path) Returns a URL to the resource that is mapped to the given path.getResourceAsStream
(String path) Returns the resource located at the named path as anInputStream
object.
-
Method Details
-
getResource
Returns a URL to the resource that is mapped to the given path.The path must begin with a / and is interpreted as relative to the current content root.
This method returns
null
if no resource is mapped to the pathname.- 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
-
getResourceAsStream
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.- 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
-