com.samskivert.velocity
Class SiteJarResourceLoader

java.lang.Object
  extended by org.apache.velocity.runtime.resource.loader.ResourceLoader
      extended by com.samskivert.velocity.SiteJarResourceLoader

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

A Velocity resource loader that loads resources from site-specific jar files. This cannot be used with the default Velocity resource manager, but is used by the SiteResourceManager which automatically handles the creation and use of this resource loader.

See Also:
SiteResourceLoader

Field Summary
protected  SiteResourceLoader _loader
          The site resource loader through which we'll load things.
 
Fields inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader
className, isCachingOn, log, modificationCheckInterval, rsvc
 
Constructor Summary
SiteJarResourceLoader(SiteResourceLoader loader)
          Constructs a site resource loader that will use the specified site identifier to map site ids to site strings.
 
Method Summary
 long getLastModified(org.apache.velocity.runtime.resource.Resource resource)
          Things won't ever be modified when loaded from the servlet context because they came from the webapp .war file and if that is reloaded, everything will be thrown away and started afresh.
 InputStream getResourceStream(String path)
          Returns the input stream that can be used to load the named resource.
 void init(org.apache.commons.collections.ExtendedProperties config)
          This is not called.
 boolean isSourceModified(org.apache.velocity.runtime.resource.Resource resource)
          Things won't ever be modified when loaded from the servlet context because they came from the webapp .war file and if that is reloaded, everything will be thrown away and started afresh.
 
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
 

Field Detail

_loader

protected SiteResourceLoader _loader
The site resource loader through which we'll load things.

Constructor Detail

SiteJarResourceLoader

public SiteJarResourceLoader(SiteResourceLoader loader)
Constructs a site resource loader that will use the specified site identifier to map site ids to site strings.

Method Detail

init

public void init(org.apache.commons.collections.ExtendedProperties config)
This is not called.

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

getResourceStream

public InputStream getResourceStream(String path)
                              throws org.apache.velocity.exception.ResourceNotFoundException
Returns the input stream that can be used to load the named resource.

Specified by:
getResourceStream in class org.apache.velocity.runtime.resource.loader.ResourceLoader
Parameters:
path - the path for the resource to be loaded.
Returns:
an input stream that can be used to read the resource.
Throws:
org.apache.velocity.exception.ResourceNotFoundException - if the resource was not found.

isSourceModified

public boolean isSourceModified(org.apache.velocity.runtime.resource.Resource resource)
Things won't ever be modified when loaded from the servlet context because they came from the webapp .war file and if that is reloaded, everything will be thrown away and started afresh.

Specified by:
isSourceModified in class org.apache.velocity.runtime.resource.loader.ResourceLoader

getLastModified

public long getLastModified(org.apache.velocity.runtime.resource.Resource resource)
Things won't ever be modified when loaded from the servlet context because they came from the webapp .war file and if that is reloaded, everything will be thrown away and started afresh. So we can punt here and return zero.

Specified by:
getLastModified in class org.apache.velocity.runtime.resource.loader.ResourceLoader


Copyright © 2000-2008 Michael Bayne. All Rights Reserved.