|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.szegedi.spring.core.io.ResourceRepresentation
public abstract class ResourceRepresentation
Represents a class that is capable of loading and caching a parsed
representation of contents of a Spring resource. In case the resource has a
URL representation and it changes, the object will be reloaded. The code
also has a special optimization for "file:" URLs. All subclasses have to do
is implement the loadRepresentation(InputStream)
method.
Constructor Summary | |
---|---|
ResourceRepresentation(org.springframework.core.io.Resource resource)
Constructs a new representation for the specified resource. |
Method Summary | |
---|---|
java.lang.Object |
getRepresentation()
Returns the representation of the resource. |
java.lang.Object |
getRepresentation(long noStaleCheckPeriod)
Returns the representation of the resource. |
org.springframework.core.io.Resource |
getResource()
|
protected abstract java.lang.Object |
loadRepresentation(java.io.InputStream in)
Implement in subclasses to load the representation of the resource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourceRepresentation(org.springframework.core.io.Resource resource)
resource
- Method Detail |
---|
public java.lang.Object getRepresentation(long noStaleCheckPeriod) throws java.lang.Exception
noStaleCheckPeriod
- If the resource's timestamp was last checked
no earlier than the specified number of milliseconds, it won't be
checked and the cached representation will be returned instead.
java.lang.Exception
- if there was an exception during loading of the
representationpublic java.lang.Object getRepresentation() throws java.lang.Exception
getRepresentation(long)
with 0 parameter, although a bit more
optimized.
java.lang.Exception
- if there was an exception during loading of the
representationpublic org.springframework.core.io.Resource getResource()
protected abstract java.lang.Object loadRepresentation(java.io.InputStream in) throws java.io.IOException
in
- the input stream with resource bytes
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |