public class SpringResourceLoader extends 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 org.slf4j.Logger |
logger |
static String |
NAME |
static String |
SPRING_RESOURCE_LOADER |
static String |
SPRING_RESOURCE_LOADER_CACHE |
static String |
SPRING_RESOURCE_LOADER_CLASS |
static String |
SPRING_RESOURCE_LOADER_PATH |
className, isCachingOn, log, modificationCheckInterval, rsvc| Constructor and Description |
|---|
SpringResourceLoader() |
| Modifier and Type | Method and Description |
|---|---|
long |
getLastModified(Resource resource)
Get the last modified time of the InputStream source
that was used to create the template.
|
Reader |
getResourceReader(String source,
String encoding)
Get the Reader that the Runtime will parse
to create a template.
|
void |
init(ExtProperties configuration)
Initialize the template loader with a
a resources class.
|
boolean |
isSourceModified(Resource resource)
Given a template, check to see if the source of InputStream
has been modified.
|
buildReader, commonInit, getClassName, getModificationCheckInterval, isCachingOn, resourceExists, setCachingOn, setModificationCheckIntervalpublic static final String NAME
public static final String SPRING_RESOURCE_LOADER_CLASS
public static final String SPRING_RESOURCE_LOADER_CACHE
public static final String SPRING_RESOURCE_LOADER
public static final String SPRING_RESOURCE_LOADER_PATH
protected final org.slf4j.Logger logger
public void init(ExtProperties configuration)
ResourceLoaderinit in class ResourceLoaderpublic Reader getResourceReader(String source, String encoding) throws ResourceNotFoundException
getResourceReader in class ResourceLoadersource - resource nameencoding - resource encodingResourceNotFoundExceptionpublic boolean isSourceModified(Resource resource)
ResourceLoaderisSourceModified in class ResourceLoaderpublic long getLastModified(Resource resource)
ResourceLoadergetLastModified in class ResourceLoaderCopyright © 2000–2021 The Apache Software Foundation. All rights reserved.