org.broadleafcommerce.common.web.resource
Class AbstractGeneratedResourceHandler
java.lang.Object
org.broadleafcommerce.common.web.resource.AbstractGeneratedResourceHandler
public abstract class AbstractGeneratedResourceHandler
- extends Object
An abstract GeneratedResourceHandler that is capable of responding to a single specified filename and generate
contents for that filename. This abstract parent will handle caching of the generated resource.
- Author:
- Andre Azzolini (apazzolini)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
generatedResourceCache
protected net.sf.ehcache.Cache generatedResourceCache
AbstractGeneratedResourceHandler
public AbstractGeneratedResourceHandler()
canHandle
public abstract boolean canHandle(String path)
- Parameters:
path -
- Returns:
- booelean determining whether or not this handler is able to handle the given request
getFileContents
public abstract org.springframework.core.io.Resource getFileContents(String path,
List<org.springframework.core.io.Resource> locations)
- Parameters:
path - locations -
- Returns:
- the Resource representing this file
isCachedResourceExpired
public abstract boolean isCachedResourceExpired(GeneratedResource cachedResource,
String path,
List<org.springframework.core.io.Resource> locations)
- Parameters:
cachedResource - path - locations -
- Returns:
- whether or not the given cachedResource needs to be regenerated
getResource
public org.springframework.core.io.Resource getResource(String path,
List<org.springframework.core.io.Resource> locations)
- Attempts to retrive the requested resource from cache. If not cached, generates the resource, caches it,
and then returns it
- Parameters:
request - location -
- Returns:
- the generated resource
getGeneratedResourceCache
protected net.sf.ehcache.Cache getGeneratedResourceCache()
Copyright © 2013. All Rights Reserved.