org.apache.velocity.runtime.resource.loader
Class URLResourceLoader
java.lang.Object
org.apache.velocity.runtime.resource.loader.ResourceLoader
org.apache.velocity.runtime.resource.loader.URLResourceLoader
public class URLResourceLoader
- extends ResourceLoader
This is a simple URL-based loader.
- Version:
- $Id: URLResourceLoader.java 191743 2005-06-21 23:22:20Z dlr $
- Author:
- Geir Magnusson Jr., Nathan Bubna
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
templateRoots
protected HashMap templateRoots
URLResourceLoader
public URLResourceLoader()
init
public void init(ExtendedProperties configuration)
- Description copied from class:
ResourceLoader
- Initialize the template loader with a
a resources class.
- Specified by:
init
in class ResourceLoader
- See Also:
ResourceLoader.init(org.apache.commons.collections.ExtendedProperties)
getResourceStream
public InputStream getResourceStream(String name)
throws ResourceNotFoundException
- Get an InputStream so that the Runtime can build a
template with it.
- Specified by:
getResourceStream
in class ResourceLoader
- Parameters:
name
- name of template to fetch bytestream of
- Returns:
- InputStream containing the template
- Throws:
ResourceNotFoundException
- if template not found
in the file template path.
isSourceModified
public boolean isSourceModified(Resource resource)
- Checks to see if a resource has been deleted, moved or modified.
- Specified by:
isSourceModified
in class ResourceLoader
- Parameters:
resource
- Resource The resource to check for modification
- Returns:
- boolean True if the resource has been modified, moved, or unreachable
getLastModified
public long getLastModified(Resource resource)
- Checks to see when a resource was last modified
- Specified by:
getLastModified
in class ResourceLoader
- Parameters:
resource
- Resource the resource to check
- Returns:
- long The time when the resource was last modified or 0 if the file can't be reached
Copyright © 2000-2007 The Apache Software Foundation. All Rights Reserved.