|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.cache.PlainResource
org.norther.tammi.core.cache.BufferedResource
public class BufferedResource
A buffered implementation of CachedResource maintaining content.
| Constructor Summary | |
|---|---|
BufferedResource(String name,
Object src)
Constructs a new resource. |
|
BufferedResource(String name,
Object src,
boolean keep)
Constructs a new resource with a keep lost flag. |
|
BufferedResource(String name,
Object src,
byte[] content)
Constructs a new resource with ready-made content. |
|
| Method Summary | |
|---|---|
byte[] |
getContents()
Gets the contents of the resource as bytes. |
InputStream |
getInputStream()
Gets the resource as a stream. |
long |
getLastModified()
Gets the resource modification time. |
long |
getLength()
Gets the length of the resource. |
void |
release()
Releases the cached resource. |
void |
setSizeLimit(int limit)
Sets a size limit for a resource. |
| Methods inherited from class org.norther.tammi.core.cache.PlainResource |
|---|
activated, expired, getCheckInterval, getContents, getName, getPath, getSizeLimit, getSource, isDeleteOnRelease, isValid, passivated, setCheckInterval, setDeleteOnRelease, setPath |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BufferedResource(String name,
Object src)
name - the name.src - the source.
public BufferedResource(String name,
Object src,
boolean keep)
name - the name.src - the source.keep - the keep lost flag.
public BufferedResource(String name,
Object src,
byte[] content)
name - the name.src - the source.content - the content.| Method Detail |
|---|
public long getLength()
Resource
getLength in interface ResourcegetLength in class PlainResourcepublic long getLastModified()
Resource
getLastModified in interface ResourcegetLastModified in class PlainResourcepublic void setSizeLimit(int limit)
Resource
setSizeLimit in interface ResourcesetSizeLimit in class PlainResourcelimit - a limit for a resource size in bytes (-1 = unlimited).
public InputStream getInputStream()
throws IOException
Resource
getInputStream in interface ResourcegetInputStream in class PlainResourceIOException - on I/O errors.
public byte[] getContents()
throws IOException
Resource
getContents in interface ResourcegetContents in class PlainResourceIOException - on I/O errors.public void release()
Resource
release in interface Resourcerelease in class PlainResource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||