org.apache.myfaces.trinidad.resource
Class CachingResourceLoader

java.lang.Object
  extended by org.apache.myfaces.trinidad.resource.ResourceLoader
      extended by org.apache.myfaces.trinidad.resource.CachingResourceLoader

public class CachingResourceLoader
extends ResourceLoader

Base class for resource loaders. Resource loaders can lookup resources as URLs from arbitrary locations, including JAR files.


Constructor Summary
CachingResourceLoader(ResourceLoader parent)
          Constructs a new CachingResourceLoader.
 
Method Summary
protected  URL findResource(String path)
          Returns the cached resource url if previously requested.
 boolean isCachable()
          Returns whether a resource is cachable.
 
Methods inherited from class org.apache.myfaces.trinidad.resource.ResourceLoader
getContentType, getContentType, getNullResourceLoader, getParent, getResource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CachingResourceLoader

public CachingResourceLoader(ResourceLoader parent)
Constructs a new CachingResourceLoader.

Parameters:
parent - the parent resource loader
Method Detail

findResource

protected URL findResource(String path)
                    throws IOException
Returns the cached resource url if previously requested. Otherwise, fully reads the resource contents stores in the cache.

Overrides:
findResource in class ResourceLoader
Parameters:
path - the resource path
Returns:
the cached resource url
Throws:
IOException - if an I/O error occurs

isCachable

public boolean isCachable()
Description copied from class: ResourceLoader
Returns whether a resource is cachable.

Overrides:
isCachable in class ResourceLoader
Returns:


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.