no.sesat.search.view.velocity
Class URLResourceLoader
java.lang.Object
org.apache.velocity.runtime.resource.loader.ResourceLoader
no.sesat.search.view.velocity.URLResourceLoader
- Direct Known Subclasses:
- URLVelocityTemplateLoader
public class URLResourceLoader
- extends org.apache.velocity.runtime.resource.loader.ResourceLoader
This is a simple URL-based loader.
ORIGINAL FROM http://svn.apache.org/repos/asf/jakarta/velocity/engine/trunk/whiteboard/geir/URLResourceLoader.java
original version Id: URLResourceLoader.java,v 1.3 2004/03/19 17:13:40 dlr Exp
MODIFIED TO SUIT SCHIBSTEDSØK's NEEDS.
There was a choice here to implement all the URL handling stuff from scratch or to plug into the existing
functionality found in no.schibstedsøk.front.search.configuration.loader
Since this class is hidden between the velocity API it made more sense to go from scratch to best
meet velocity's requirements...
- Version:
- $Id: URLResourceLoader.java,v 1.3 2004/03/19 17:13:40 dlr Exp $
| Fields inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader |
className, isCachingOn, log, modificationCheckInterval, rsvc |
|
Method Summary |
long |
getLastModified(org.apache.velocity.runtime.resource.Resource resource)
|
InputStream |
getResourceStream(String url)
Get an InputStream so that the Runtime can build a
template with it. |
void |
init(org.apache.commons.collections.ExtendedProperties configuration)
|
boolean |
isSourceModified(org.apache.velocity.runtime.resource.Resource resource)
|
| 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 |
URLResourceLoader
public URLResourceLoader()
URLResourceLoader
public URLResourceLoader(Site site)
init
public void init(org.apache.commons.collections.ExtendedProperties configuration)
-
- Specified by:
init in class org.apache.velocity.runtime.resource.loader.ResourceLoader
getResourceStream
public InputStream getResourceStream(String url)
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:
url - url of template to fetch bytestream of
- 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)
-
- Specified by:
isSourceModified in class org.apache.velocity.runtime.resource.loader.ResourceLoader
getLastModified
public long getLastModified(org.apache.velocity.runtime.resource.Resource resource)
-
- Specified by:
getLastModified in class org.apache.velocity.runtime.resource.loader.ResourceLoader
Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.