org.abstracthorizon.danube.velocity
Class AbsoluteFileResourceLoader

java.lang.Object
  extended by org.apache.velocity.runtime.resource.loader.ResourceLoader
      extended by org.abstracthorizon.danube.velocity.AbsoluteFileResourceLoader

public class AbsoluteFileResourceLoader
extends org.apache.velocity.runtime.resource.loader.ResourceLoader

A loader for templates stored on the file system adapted for Danube.

Author:
Daniel Sendula, Jason van Zyl

Field Summary
 
Fields inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader
className, isCachingOn, modificationCheckInterval, rsvc
 
Constructor Summary
AbsoluteFileResourceLoader()
           
 
Method Summary
 long getLastModified(org.apache.velocity.runtime.resource.Resource resource)
          Returns when velocity template was last modified
 InputStream getResourceStream(String templateName)
          Get an InputStream so that the Runtime can build a template with it.
 void init(org.apache.commons.collections.ExtendedProperties configuration)
          Initialises this loaded
 boolean isSourceModified(org.apache.velocity.runtime.resource.Resource resource)
          How to keep track of all the modified times across the paths.
 
Methods inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader
commonInit, getClassName, getModificationCheckInterval, isCachingOn, setCachingOn, setModificationCheckInterval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbsoluteFileResourceLoader

public AbsoluteFileResourceLoader()
Method Detail

init

public void init(org.apache.commons.collections.ExtendedProperties configuration)
Initialises this loaded

Specified by:
init in class org.apache.velocity.runtime.resource.loader.ResourceLoader
Parameters:
configuration - configuration

getResourceStream

public InputStream getResourceStream(String templateName)
                              throws org.apache.velocity.exception.ResourceNotFoundException
Get an InputStream so that the Runtime can build a template with it.

Specified by:
getResourceStream in class org.apache.velocity.runtime.resource.loader.ResourceLoader
Parameters:
templateName - name of template to get
Returns:
InputStream containing the template
Throws:
org.apache.velocity.exception.ResourceNotFoundException - if template not found in the file template path.

isSourceModified

public boolean isSourceModified(org.apache.velocity.runtime.resource.Resource resource)
How to keep track of all the modified times across the paths. Note that a file might have appeared in a directory which is earlier in the path; so we should search the path and see if the file we find that way is the same as the one that we have cached.

Specified by:
isSourceModified in class org.apache.velocity.runtime.resource.loader.ResourceLoader
Parameters:
resource - template's resource
Returns:
is source is modified

getLastModified

public long getLastModified(org.apache.velocity.runtime.resource.Resource resource)
Returns when velocity template was last modified

Specified by:
getLastModified in class org.apache.velocity.runtime.resource.loader.ResourceLoader
Parameters:
resource - template's resource
Returns:
long template


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.