public class ChainedResourceLoader extends Object implements ResourceLoader
ResourceLoader delegates to a sequence of other loaders, asking
each one for the requested resource in turn.| Constructor and Description |
|---|
ChainedResourceLoader(ResourceLoader... loaders)
Creates a new ChainedResourceLoader.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
exists(String path)
Returns
true, if any of the delegate loaders returns from
exists(String) for the given path. |
String |
load(String path,
String charset)
The first delegate that returns from
exists(String) for
the given path will have load(String, String) invoked, and the
result will be retured. |
public ChainedResourceLoader(ResourceLoader... loaders)
loaders - the loaders to delegate to. Order of the loaders is important.public boolean exists(String path) throws IOException
true, if any of the delegate loaders returns from
exists(String) for the given path.exists in interface ResourceLoaderpath - resource path.true if the resource exists.IOException - when i/o error occurs while checking for resource existence.public String load(String path, String charset) throws IOException
exists(String) for
the given path will have load(String, String) invoked, and the
result will be retured.load in interface ResourceLoaderpath - resource path.charset - character set name, valid with respect to
Charset.IOException - when i/o error occurs while loading the resource, or charset
is invalid.Copyright © 2014 Asual DZZD. All Rights Reserved.