public class ResourceLoaderAdaptor extends Object implements ResourceLoader
Modifier and Type | Method and Description |
---|---|
void |
close(Reader reader)
Close the reader.
|
Object |
getKey(String filename)
Returns an object that can be used to uniquely identify the file corresponding to the given
file name in the context of this ResourceLoader.
|
Object |
getResourceVersionId(String filename)
Some applications, e.g.
|
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 Reader open(String name) throws IOException
ResourceLoader
ResourceLoader.close(Reader)
when done with the
reader.open
in interface ResourceLoader
name
- the name of the resourceIOException
- if resource fails to openpublic Reader openOrFail(String name) throws JSilverTemplateNotFoundException, IOException
ResourceLoader
ResourceLoader.close(Reader)
when done with the
reader.openOrFail
in interface ResourceLoader
name
- the name of the resourceJSilverTemplateNotFoundException
- if resource is not foundIOException
- if resource fails to openpublic void close(Reader reader) throws IOException
ResourceLoader
close
in interface ResourceLoader
reader
- the reader to closeIOException
- if reader fasils to closepublic Object getKey(String filename)
ResourceLoader
getKey
in interface ResourceLoader
filename
- the name we want to identifypublic Object getResourceVersionId(String filename)
File.getCanonicalFile()
, if possible.getResourceVersionId
in interface ResourceLoader
filename
- the name of the resource to check for resourcesCopyright © 2010-2013 Google. All Rights Reserved.