Package org.restlet.ext.velocity
Class RepresentationResourceLoader
- java.lang.Object
-
- org.apache.velocity.runtime.resource.loader.ResourceLoader
-
- org.restlet.ext.velocity.RepresentationResourceLoader
-
public class RepresentationResourceLoader extends ResourceLoader
Velocity resource loader based on a static map of representations or on a default representation.- Author:
- Jerome Louvel
-
-
Field Summary
-
Fields inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader
className, isCachingOn, log, modificationCheckInterval, rsvc
-
-
Constructor Summary
Constructors Constructor Description RepresentationResourceLoader(org.restlet.representation.Representation defaultRepresentation)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getLastModified(Resource resource)
java.io.Reader
getResourceReader(java.lang.String source, java.lang.String encoding)
static java.util.Map<java.lang.String,org.restlet.representation.Representation>
getStore()
Returns the cache of template representations.void
init(ExtProperties configuration)
boolean
isSourceModified(Resource resource)
-
Methods inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader
buildReader, commonInit, getClassName, getModificationCheckInterval, isCachingOn, resourceExists, setCachingOn, setModificationCheckInterval
-
-
-
-
Method Detail
-
getStore
public static java.util.Map<java.lang.String,org.restlet.representation.Representation> getStore()
Returns the cache of template representations.- Returns:
- The cache of template representations.
-
getLastModified
public long getLastModified(Resource resource)
- Specified by:
getLastModified
in classResourceLoader
-
isSourceModified
public boolean isSourceModified(Resource resource)
- Specified by:
isSourceModified
in classResourceLoader
-
getResourceReader
public java.io.Reader getResourceReader(java.lang.String source, java.lang.String encoding) throws ResourceNotFoundException
- Specified by:
getResourceReader
in classResourceLoader
- Throws:
ResourceNotFoundException
-
init
public void init(ExtProperties configuration)
- Specified by:
init
in classResourceLoader
-
-