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
,
org.apache.velocity.runtime.resource.loader.FileResourceLoader
Modifier and Type | Field and Description |
---|---|
protected Log |
logger |
static java.lang.String |
NAME |
private ResourceLoader |
resourceLoader |
private java.lang.String[] |
resourceLoaderPaths |
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(Resource resource) |
java.io.InputStream |
getResourceStream(java.lang.String source) |
void |
init(ExtendedProperties configuration) |
boolean |
isSourceModified(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
private ResourceLoader resourceLoader
private java.lang.String[] resourceLoaderPaths
public void init(ExtendedProperties configuration)
public java.io.InputStream getResourceStream(java.lang.String source) throws ResourceNotFoundException
ResourceNotFoundException
public boolean isSourceModified(Resource resource)
public long getLastModified(Resource resource)