org.apache.maven.plugin.resource.loader
Class ProjectResourceLoader

java.lang.Object
  extended by org.apache.velocity.runtime.resource.loader.ResourceLoader
      extended by org.apache.maven.plugin.resource.loader.ProjectResourceLoader

public class ProjectResourceLoader
extends ResourceLoader

Resource Loader for external projects.

Version:
$Id: ProjectResourceLoader.java 1579078 2014-03-18 22:44:41Z dennisl $

Field Summary
 
Fields inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader
className, isCachingOn, log, modificationCheckInterval, rsvc
 
Constructor Summary
ProjectResourceLoader()
           
 
Method Summary
 long getLastModified(Resource resource)
           
 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)
           
 boolean isSourceModified(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, resourceExists, setCachingOn, setModificationCheckInterval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectResourceLoader

public ProjectResourceLoader()
Method Detail

init

public void init(org.apache.commons.collections.ExtendedProperties configuration)
Specified by:
init in class ResourceLoader

getResourceStream

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

Specified by:
getResourceStream in class ResourceLoader
Parameters:
templateName - name of template to get
Returns:
InputStream containing the template
Throws:
ResourceNotFoundException - if template not found in the file template path.

isSourceModified

public boolean isSourceModified(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 ResourceLoader

getLastModified

public long getLastModified(Resource resource)
Specified by:
getLastModified in class ResourceLoader


Copyright © 2002–2014 The Apache Software Foundation. All rights reserved.