public class FeatureResourceLoader extends Object
| Constructor and Description |
|---|
FeatureResourceLoader() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
fileHasChanged(File file,
long lastModified) |
protected String |
getFileContent(File file) |
protected String |
getOptPath(String orig) |
protected String |
getResourceContent(String resource) |
FeatureResource |
load(Uri uri,
Map<String,String> attribs)
Primary, and only public, method of FeatureResourceLoader.
|
protected FeatureResource |
loadFile(String path,
Map<String,String> attribs) |
protected FeatureResource |
loadResource(String path,
Map<String,String> attribs) |
protected FeatureResource |
loadUri(Uri uri,
Map<String,String> attribs) |
void |
setHttpFetcher(HttpFetcher fetcher) |
void |
setSupportFileUpdates(int updateCheckFrequency) |
void |
setTimeSource(TimeSource timeSource) |
@Inject public void setHttpFetcher(HttpFetcher fetcher)
@Inject public void setTimeSource(TimeSource timeSource)
@Inject(optional=true) public void setSupportFileUpdates(int updateCheckFrequency)
public FeatureResource load(Uri uri, Map<String,String> attribs) throws GadgetException
uri, which was decorated with the provided list of attributes.
The default implementation loads both file and res-schema resources using
ResourceLoader, attempting to load optimized content for files named [file].js as [file].opt.js.
Override this method to provide custom functionality. Basic loadFile, loadResource, and loadUri
methods are kept protected for easy reuse.uri - Uri of resource to be loaded.attribs - Attributes decorating the resource in the corresponding feature.xmlGadgetException - If any failure occurs during this process.protected FeatureResource loadFile(String path, Map<String,String> attribs) throws IOException
IOExceptionprotected FeatureResource loadResource(String path, Map<String,String> attribs) throws IOException
IOExceptionprotected FeatureResource loadUri(Uri uri, Map<String,String> attribs)
protected boolean fileHasChanged(File file, long lastModified)
Copyright © 2007-2012. All Rights Reserved.