|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.scripting.support.ResourceScriptSource
public class ResourceScriptSource
ScriptSource implementation based on Spring's
Resource
abstraction.
Loads the script text from the underlying
Resource's
InputStream
and tracks the file timestamp of the Resource
(if possible).
InputStreamSource.getInputStream()
,
Resource.getFile()
,
ResourceLoader
Field Summary | |
---|---|
protected Log |
logger
Logger available to subclasses |
Constructor Summary | |
---|---|
ResourceScriptSource(Resource resource)
Create a new ResourceScriptSource for the given resource. |
Method Summary | |
---|---|
Resource |
getResource()
Return the Resource to load the
script from. |
String |
getScriptAsString()
Retrieve the current script source text as String. |
boolean |
isModified()
Indicate whether the underlying script data was modified since the last time getScriptAsString() was called. |
protected long |
retrieveLastModifiedTime()
Retrieve the current last-modified timestamp of the underlying timestamp. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final Log logger
Constructor Detail |
---|
public ResourceScriptSource(Resource resource)
resource
- the Resource
to load the script from
IllegalArgumentException
- if the supplied Resource
is null
Method Detail |
---|
public final Resource getResource()
Resource
to load the
script from.
public String getScriptAsString() throws IOException
ScriptSource
getScriptAsString
in interface ScriptSource
IOException
- if script retrieval failedpublic boolean isModified()
ScriptSource
getScriptAsString()
was called. Returns true
if
the script has not been read yet.
isModified
in interface ScriptSource
ScriptSource.getScriptAsString()
protected long retrieveLastModifiedTime()
public String toString()
toString
in class Object
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |