public class

SpringResourceLoader

extends ResourceLoader
java.lang.Object
   ↳ ResourceLoader
     ↳ org.springframework.ui.velocity.SpringResourceLoader

Class Overview

Velocity ResourceLoader adapter that loads via a Spring ResourceLoader. Used by VelocityEngineFactory for any resource loader path that cannot be resolved to a 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.

See Also

Summary

Constants
String NAME
String SPRING_RESOURCE_LOADER
String SPRING_RESOURCE_LOADER_CACHE
String SPRING_RESOURCE_LOADER_CLASS
String SPRING_RESOURCE_LOADER_PATH
Fields
protected final Log logger
Public Constructors
SpringResourceLoader()
Public Methods
long getLastModified(Resource resource)
InputStream getResourceStream(String source)
void init(ExtendedProperties configuration)
boolean isSourceModified(Resource resource)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String NAME

Constant Value: "spring"

public static final String SPRING_RESOURCE_LOADER

Constant Value: "spring.resource.loader"

public static final String SPRING_RESOURCE_LOADER_CACHE

Constant Value: "spring.resource.loader.cache"

public static final String SPRING_RESOURCE_LOADER_CLASS

Constant Value: "spring.resource.loader.class"

public static final String SPRING_RESOURCE_LOADER_PATH

Constant Value: "spring.resource.loader.path"

Fields

protected final Log logger

Public Constructors

public SpringResourceLoader ()

Public Methods

public long getLastModified (Resource resource)

public InputStream getResourceStream (String source)

Throws
ResourceNotFoundException

public void init (ExtendedProperties configuration)

public boolean isSourceModified (Resource resource)