Package org.gluu.oxtrust.util.velocity
Class ClasspathPathResourceLoader
java.lang.Object
org.apache.velocity.runtime.resource.loader.ResourceLoader
org.gluu.oxtrust.util.velocity.ClasspathPathResourceLoader
public class ClasspathPathResourceLoader
extends org.apache.velocity.runtime.resource.loader.ResourceLoader
A loader for templates stored on the classpath. Treats the template as
relative to the configured root path. If the root path is empty treats the
template name as an absolute path.
-
Field Summary
Fields inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader
className, isCachingOn, log, modificationCheckInterval, rsvc -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetLastModified(org.apache.velocity.runtime.resource.Resource resource) getResourceReader(String templateName, String encoding) Get a Reader so that the Runtime can build a template with it.voidinit(org.apache.velocity.util.ExtProperties configuration) booleanisSourceModified(org.apache.velocity.runtime.resource.Resource resource) Methods inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader
buildReader, commonInit, getClassName, getModificationCheckInterval, isCachingOn, resourceExists, setCachingOn, setModificationCheckInterval
-
Constructor Details
-
ClasspathPathResourceLoader
public ClasspathPathResourceLoader()
-
-
Method Details
-
init
public void init(org.apache.velocity.util.ExtProperties configuration) - Specified by:
initin classorg.apache.velocity.runtime.resource.loader.ResourceLoader- See Also:
-
getResourceReader
public Reader getResourceReader(String templateName, String encoding) throws org.apache.velocity.exception.ResourceNotFoundException Get a Reader so that the Runtime can build a template with it.- Specified by:
getResourceReaderin classorg.apache.velocity.runtime.resource.loader.ResourceLoader- Parameters:
encoding- asked encodingname- name of template to get- Returns:
- InputStream containing the template
- Throws:
org.apache.velocity.exception.ResourceNotFoundException- if template not found in classpath.- Since:
- 2.0
-
isSourceModified
public boolean isSourceModified(org.apache.velocity.runtime.resource.Resource resource) - Specified by:
isSourceModifiedin classorg.apache.velocity.runtime.resource.loader.ResourceLoader- See Also:
-
getLastModified
public long getLastModified(org.apache.velocity.runtime.resource.Resource resource) - Specified by:
getLastModifiedin classorg.apache.velocity.runtime.resource.loader.ResourceLoader- See Also:
-