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 resource,
String[] paths)
Returns
true, if any of the delegate loaders returns from
#exists(String) for the given path. |
String |
load(String resource,
String[] paths,
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 resource, String[] paths) throws IOException
true, if any of the delegate loaders returns from
#exists(String) for the given path.exists 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
#exists(String) for
the given path will have #load(String, String) invoked, and the
result will be retured.load 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.Copyright © 2014 Asual DZZD. All Rights Reserved.