public class CompositeResourceLoader extends Object implements ResourceLoader
ResourceLoader| Constructor and Description |
|---|
CompositeResourceLoader(Iterable<ResourceLoader> loaders) |
CompositeResourceLoader(ResourceLoader... loaders) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(ResourceLoader loader) |
void |
close(Reader reader)
Close the reader.
|
Object |
getKey(String filename)
We return the filename as the key of uniqueness as we assume that if this
CompositeResourceLoader is in use, then there won't be another ResourceLoader that we are
competing against.
|
Object |
getResourceVersionId(String filename)
Return the first non-null version identifier found among the ResourceLoaders, using the same
search order as
open(String). |
Reader |
open(String name)
Open a resource.
|
Reader |
openOrFail(String name)
Open a resource or throw an exception if no such resource is found.
|
public CompositeResourceLoader(Iterable<ResourceLoader> loaders)
public CompositeResourceLoader(ResourceLoader... loaders)
public void add(ResourceLoader loader)
public Reader open(String name) throws IOException
ResourceLoaderResourceLoader.close(Reader) when done with the
reader.open in interface ResourceLoadername - the name of the resourceIOException - if resource fails to openpublic Reader openOrFail(String name) throws JSilverTemplateNotFoundException, IOException
ResourceLoaderResourceLoader.close(Reader) when done with the
reader.openOrFail in interface ResourceLoadername - the name of the resourceJSilverTemplateNotFoundException - if resource is not foundIOException - if resource fails to openpublic void close(Reader reader) throws IOException
ResourceLoaderclose in interface ResourceLoaderreader - the reader to closeIOException - if reader fasils to closepublic Object getKey(String filename)
getKey in interface ResourceLoaderfilename - the name we want to identifypublic Object getResourceVersionId(String filename)
open(String).getResourceVersionId in interface ResourceLoaderfilename - the name of the resource to check for resourcesCopyright © 2010-2012 Google. All Rights Reserved.