public class SpringResourceLoader
extends org.apache.velocity.runtime.resource.loader.ResourceLoader
java.io.File
.
Note that this loader does not allow for modification detection:
Use Velocity's default FileResourceLoader for java.io.File
resources.
Expects "spring.resource.loader" and "spring.resource.loader.path"
application attributes in the Velocity runtime: the former of type
org.springframework.core.io.ResourceLoader
, the latter a String.
VelocityEngineFactory.setResourceLoaderPath(java.lang.String)
,
ResourceLoader
,
FileResourceLoader
Modifier and Type | Field and Description |
---|---|
protected Log |
logger |
static java.lang.String |
NAME |
static java.lang.String |
SPRING_RESOURCE_LOADER |
static java.lang.String |
SPRING_RESOURCE_LOADER_CACHE |
static java.lang.String |
SPRING_RESOURCE_LOADER_CLASS |
static java.lang.String |
SPRING_RESOURCE_LOADER_PATH |
Constructor and Description |
---|
SpringResourceLoader() |
Modifier and Type | Method and Description |
---|---|
long |
getLastModified(org.apache.velocity.runtime.resource.Resource resource) |
java.io.InputStream |
getResourceStream(java.lang.String source) |
void |
init(org.apache.commons.collections.ExtendedProperties configuration) |
boolean |
isSourceModified(org.apache.velocity.runtime.resource.Resource resource) |
public static final java.lang.String NAME
public static final java.lang.String SPRING_RESOURCE_LOADER_CLASS
public static final java.lang.String SPRING_RESOURCE_LOADER_CACHE
public static final java.lang.String SPRING_RESOURCE_LOADER
public static final java.lang.String SPRING_RESOURCE_LOADER_PATH
protected final Log logger
public void init(org.apache.commons.collections.ExtendedProperties configuration)
init
in class org.apache.velocity.runtime.resource.loader.ResourceLoader
public java.io.InputStream getResourceStream(java.lang.String source) throws org.apache.velocity.exception.ResourceNotFoundException
getResourceStream
in class org.apache.velocity.runtime.resource.loader.ResourceLoader
org.apache.velocity.exception.ResourceNotFoundException
public boolean isSourceModified(org.apache.velocity.runtime.resource.Resource resource)
isSourceModified
in class org.apache.velocity.runtime.resource.loader.ResourceLoader
public long getLastModified(org.apache.velocity.runtime.resource.Resource resource)
getLastModified
in class org.apache.velocity.runtime.resource.loader.ResourceLoader