public class FileContentResourceLoader extends Object implements ContentResourceLoader
ContentResourceLoader
implementation for loading resources from a directory.Constructor and Description |
---|
FileContentResourceLoader(File baseDir) |
Modifier and Type | Method and Description |
---|---|
URL |
getResource(String path)
Returns a URL in file URL scheme.
|
InputStream |
getResourceAsStream(String path)
Returns the resource located at the named path as
an
InputStream object. |
public FileContentResourceLoader(File baseDir)
public URL getResource(String path) throws MalformedURLException
getResource
in interface ContentResourceLoader
path
- a String
specifying
the path to the resourcenull
if there is no resource at that pathMalformedURLException
- if the pathname is not given in
the correct formpublic InputStream getResourceAsStream(String path) throws IOException
ContentResourceLoader
InputStream
object.
The path must be specified according
to the rules given in getResource
.
This method returns null
if no resource exists at
the specified path.
getResourceAsStream
in interface ContentResourceLoader
path
- a String
specifying the path
to the resourceInputStream
returned to the
caller, or null
if no resource
exists at the specified pathIOException
Copyright © 2007–2017 Hippo B.V. (http://www.onehippo.com). All rights reserved.