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 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 |
Constructor and Description |
---|
SpringResourceLoader() |
Modifier and Type | Method and Description |
---|---|
long |
getLastModified(org.apache.velocity.runtime.resource.Resource resource) |
InputStream |
getResourceStream(String source) |
void |
init(org.apache.commons.collections.ExtendedProperties configuration) |
boolean |
isSourceModified(org.apache.velocity.runtime.resource.Resource resource) |
public 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 Log logger
public void init(org.apache.commons.collections.ExtendedProperties configuration)
init
in class org.apache.velocity.runtime.resource.loader.ResourceLoader
public InputStream getResourceStream(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