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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    getLastModified(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.
    void
    init(org.apache.velocity.util.ExtProperties configuration)
     
    boolean
    isSourceModified(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ClasspathPathResourceLoader

      public ClasspathPathResourceLoader()
  • Method Details

    • init

      public void init(org.apache.velocity.util.ExtProperties configuration)
      Specified by:
      init in class org.apache.velocity.runtime.resource.loader.ResourceLoader
      See Also:
      • ResourceLoader.init(org.apache.velocity.util.ExtProperties)
    • 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:
      getResourceReader in class org.apache.velocity.runtime.resource.loader.ResourceLoader
      Parameters:
      encoding - asked encoding
      name - 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:
      isSourceModified in class org.apache.velocity.runtime.resource.loader.ResourceLoader
      See Also:
      • ResourceLoader.isSourceModified(org.apache.velocity.runtime.resource.Resource)
    • getLastModified

      public long getLastModified(org.apache.velocity.runtime.resource.Resource resource)
      Specified by:
      getLastModified in class org.apache.velocity.runtime.resource.loader.ResourceLoader
      See Also:
      • ResourceLoader.getLastModified(org.apache.velocity.runtime.resource.Resource)