|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.oscache.web.filter.ResponseContent
public class ResponseContent
Holds the servlet response in a byte array so that it can be held in the cache (and, since this class is serializable, optionally persisted to disk).
Field Summary | |
---|---|
private ByteArrayOutputStream |
bout
|
private byte[] |
content
|
private String |
contentEncoding
|
private String |
contentType
|
private long |
expires
|
private long |
lastModified
|
private Locale |
locale
|
private long |
maxAge
|
Constructor Summary | |
---|---|
ResponseContent()
|
Method Summary | |
---|---|
void |
commit()
Called once the response has been written in its entirety. |
String |
getContentEncoding()
|
String |
getContentType()
|
long |
getExpires()
|
long |
getLastModified()
|
long |
getMaxAge()
Returns the max age of the content in miliseconds. |
OutputStream |
getOutputStream()
Get an output stream. |
int |
getSize()
Gets the size of this cached content. |
boolean |
isContentGZiped()
|
void |
setContentEncoding(String contentEncoding)
|
void |
setContentType(String value)
Set the content type. |
void |
setExpires(long value)
Sets the expires date and time in miliseconds. |
void |
setLastModified(long value)
|
void |
setLocale(Locale value)
Set the Locale. |
void |
setMaxAge(long value)
Sets the max age date and time in miliseconds. |
void |
writeTo(javax.servlet.ServletResponse response)
Writes this cached data out to the supplied ServletResponse . |
void |
writeTo(javax.servlet.ServletResponse response,
boolean fragment,
boolean acceptsGZip)
Writes this cached data out to the supplied ServletResponse . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private transient ByteArrayOutputStream bout
private Locale locale
private String contentEncoding
private String contentType
private byte[] content
private long expires
private long lastModified
private long maxAge
Constructor Detail |
---|
public ResponseContent()
Method Detail |
---|
public String getContentType()
public void setContentType(String value)
public long getLastModified()
public void setLastModified(long value)
public String getContentEncoding()
public void setContentEncoding(String contentEncoding)
public void setLocale(Locale value)
public long getExpires()
public void setExpires(long value)
value
- time in miliseconds when the content will expirepublic long getMaxAge()
public void setMaxAge(long value)
value
- sets the intialpublic OutputStream getOutputStream()
SplitServletOutputStream
to capture the original (uncached) response into a byte array.
public int getSize()
-1
.public void commit()
public void writeTo(javax.servlet.ServletResponse response) throws IOException
ServletResponse
.
response
- The servlet response to output the cached content to.
IOException
public void writeTo(javax.servlet.ServletResponse response, boolean fragment, boolean acceptsGZip) throws IOException
ServletResponse
.
response
- The servlet response to output the cached content to.fragment
- is true if this content a fragment or part of a pageacceptsGZip
- is true if client browser supports gzip compression
IOException
public boolean isContentGZiped()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |