NVelocity.Runtime.Resource.Loader
Class FileResourceLoader

A loader for templates stored on the file system.

Field Summary
System.Collections.ArrayList paths
         The paths to search for templates.
System.Collections.Hashtable templatePaths
         Used to map the path that a template was found on so that we can properly check the modification times of the files.

Fields inherited from class NVelocity.Runtime.Resource.Loader.ResourceLoader
className, isCachingOn_Renamed_Field, modificationCheckInterval, rsvc

Constructor Summary
FileResourceLoader()
        Initializes a new instance of the FileResourceLoader class.

Properties inherited from class NVelocity.Runtime.Resource.Loader.ResourceLoader
CachingOn, ClassName, ModificationCheckInterval

Method Summary
long getLastModified(NVelocity.Runtime.Resource.Resource resource)
System.IO.Stream getResourceStream(string templateName)
         Get an InputStream so that the Runtime can build a template with it.
void init(Commons.Collections.ExtendedProperties configuration)
bool isSourceModified(NVelocity.Runtime.Resource.Resource resource)
         How to keep track of all the modified times across the paths.

Methods inherited from class NVelocity.Runtime.Resource.Loader.ResourceLoader
commonInit, isCachingOn

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString


Field Detail

paths

protected System.Collections.ArrayList paths

The paths to search for templates.


templatePaths

protected System.Collections.Hashtable templatePaths

Used to map the path that a template was found on so that we can properly check the modification times of the files.

Constructor Detail

FileResourceLoader

public FileResourceLoader()

Initializes a new instance of the FileResourceLoader class.

Method Detail

getLastModified

public long getLastModified(NVelocity.Runtime.Resource.Resource resource)


getResourceStream

public System.IO.Stream getResourceStream(string templateName)

Get an InputStream so that the Runtime can build a template with it.

Parameters:
name - name of template to get
Returns:
InputStream containing the template @throws ResourceNotFoundException if template not found in the file template path.

init

public void init(Commons.Collections.ExtendedProperties configuration)


isSourceModified

public bool isSourceModified(NVelocity.Runtime.Resource.Resource resource)

How to keep track of all the modified times across the paths.