public abstract class StreamResourceLoader extends Object implements ResourceLoader
openStream(String) - a non null return value indicates valid
resource.| Constructor and Description |
|---|
StreamResourceLoader() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
exists(String resource,
String[] paths)
Checks if the given resource exists.
|
protected abstract String |
getSchema()
Returns the schema name associated with the loader.
|
String |
load(String resource,
String[] paths,
String charset)
Loads the given resource's contents.
|
protected abstract InputStream |
openStream(String path)
Returns an
InputStream for reading the resource. |
protected String |
readStream(InputStream is,
String charset) |
protected abstract String getSchema()
protected abstract InputStream openStream(String path) throws IOException
InputStream for reading the resource.path - the path of the resource.InputStream or null if the resource does not
exist.IOException - when i/o operation fails.public boolean exists(String resource, String[] paths) throws IOException
ResourceLoaderexists in interface ResourceLoaderresource - relative resource file path.paths - paths to search for resource under.true if the resource exists.IOException - when i/o error occurs while checking for resource existence.public String load(String resource, String[] paths, String charset) throws IOException
ResourceLoaderload in interface ResourceLoaderresource - relative resource file path.paths - paths to search for resource under.charset - character set name, valid with respect to
Charset.IOException - when i/o error occurs while loading the resource, or charset
is invalid.protected String readStream(InputStream is, String charset) throws IOException
IOExceptionCopyright © 2014 Asual DZZD. All Rights Reserved.