|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.riotfamily.cachius.CacheItem
public class CacheItem
Representation of cached item that is backed by a file. The captured HTTP headers are kept in memory and are serialized by the default java serialization mechanism. The actual content is read from a file to avoid the overhead of object deserialization on each request.
Constructor Summary | |
---|---|
protected |
CacheItem(CacheEntry entry,
File cacheDir)
Creates a new CacheItem in the specified directory. |
Method Summary | |
---|---|
void |
clear()
|
protected void |
delete()
|
boolean |
exists()
Checks whether the cache file exists, is a regular file and any data has been ever written into it. |
protected File |
getDir()
|
Headers |
getHeaders()
|
Set<File> |
getInvolvedFiles()
|
long |
getLastFileModification()
Returns the most recent modification date of the involved files. |
long |
getLastModified()
Returns the last modification time. |
OutputStream |
getOutputStream()
|
Map<String,String> |
getProperties()
Returns the properties. |
int |
getSize()
Returns the size of the cached data in bytes. |
Set<String> |
getTags()
Returns the item's tags. |
Writer |
getWriter()
|
void |
gzipContent()
|
void |
invalidate()
Invalidates the item. |
boolean |
isExpired()
|
boolean |
isInvalidated()
|
void |
setContentType(String contentType)
Sets the Content-Type. |
void |
setCookies(Cookies cookies)
Sets cookies. |
void |
setHeaders(Headers headers)
Sets HTTP headers. |
void |
setInvolvedFiles(Set<File> files)
|
void |
setLastModified(long lastModified)
Sets the last modification time. |
void |
setProperties(Map<String,String> properties)
Sets shared properties. |
void |
setSetContentLength(boolean setContentLength)
Sets whether a Content-Length header should be set. |
void |
setTags(Set<String> tags)
Sets tags which can be used to look up the item for invalidation. |
void |
setTimeToLive(long ttl)
|
String |
toString()
|
void |
writeTo(HttpServletResponse response)
|
void |
writeTo(OutputStream out)
|
void |
writeTo(Writer out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected CacheItem(CacheEntry entry, File cacheDir) throws IOException
IOException
Method Detail |
---|
public void setTags(Set<String> tags)
public Set<String> getTags()
public void setInvolvedFiles(Set<File> files)
public Set<File> getInvolvedFiles()
public long getLastFileModification()
public long getLastModified()
public void setLastModified(long lastModified)
public void invalidate()
public boolean isInvalidated()
public void setTimeToLive(long ttl)
public boolean isExpired()
public boolean exists()
public int getSize()
protected File getDir()
public void setContentType(String contentType)
public void setSetContentLength(boolean setContentLength)
public void setHeaders(Headers headers)
public Headers getHeaders()
public void setCookies(Cookies cookies)
public void setProperties(Map<String,String> properties)
SharedProperties
public Map<String,String> getProperties()
public Writer getWriter() throws UnsupportedEncodingException, FileNotFoundException
UnsupportedEncodingException
FileNotFoundException
public OutputStream getOutputStream() throws FileNotFoundException
FileNotFoundException
public void gzipContent() throws IOException
IOException
public void writeTo(HttpServletResponse response) throws IOException
IOException
public void writeTo(OutputStream out) throws IOException
IOException
public void writeTo(Writer out) throws IOException
IOException
public void clear() throws IOException
IOException
protected void delete()
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |