|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.loom.servlet.CacheControl
public class CacheControl
Contains the caching information related to the response object. This information tells the browser about how it is expected to cache the server response.
Constructor Summary | |
---|---|
CacheControl()
|
Method Summary | |
---|---|
CacheControl |
forever()
Sets the response to never expire. |
java.lang.Boolean |
getCacheNever()
|
java.lang.Integer |
getCacheSeconds()
|
java.lang.String |
getEtag()
|
java.util.Date |
getLastModified()
|
boolean |
isResourceModified(LoomServletRequest request)
Compares this CacheControl data with the request headers, and returns true if the browser page is outdated and a new one should be sent. |
CacheControl |
never()
Invoke this method to never cache |
void |
setCacheDays(int days)
Deprecated. use withDays(int) instead |
void |
setCacheForever()
Deprecated. use forEver() instead |
void |
setCacheHours(int hours)
Deprecated. use withHours(int) instead |
void |
setCacheMinutes(int minutes)
Deprecated. use withMinutes(int) instead |
void |
setCacheNever()
Deprecated. use never() instead |
void |
setCacheSeconds(java.lang.Integer seconds)
Deprecated. use withSeconds(Integer) instead |
void |
setCacheYears(int years)
Deprecated. use withDays(int) instead |
void |
setEtag(java.lang.String etag)
Deprecated. use withEtag() instead |
void |
setLastModified(java.util.Date lastModified)
Deprecated. use withLastModified() instead |
CacheControl |
withDays(int days)
|
CacheControl |
withEtag(java.lang.String etag)
|
CacheControl |
withHours(int hours)
|
CacheControl |
withLastModified(java.util.Date lastModified)
|
CacheControl |
withMinutes(int minutes)
|
CacheControl |
withSeconds(java.lang.Integer seconds)
|
CacheControl |
withYears(int years)
|
void |
writeHeaders(LoomServletResponse response)
Write the headers for a 200 (OK) or 304 (NOT_MODIFIED) response. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CacheControl()
Method Detail |
---|
public boolean isResourceModified(LoomServletRequest request)
request
- the current servlet request
public void writeHeaders(LoomServletResponse response)
public void setCacheForever()
public CacheControl forever()
public java.util.Date getLastModified()
public void setLastModified(java.util.Date lastModified)
public CacheControl withLastModified(java.util.Date lastModified)
public java.lang.String getEtag()
public void setEtag(java.lang.String etag)
public CacheControl withEtag(java.lang.String etag)
public java.lang.Integer getCacheSeconds()
public void setCacheSeconds(java.lang.Integer seconds)
public CacheControl withSeconds(java.lang.Integer seconds)
seconds
- the number of seconds to store the resource in the browser cache, starting nowpublic void setCacheMinutes(int minutes)
public CacheControl withMinutes(int minutes)
minutes
- the number of minutes to store the resource in the browser cache, starting nowpublic void setCacheHours(int hours)
public CacheControl withHours(int hours)
hours
- the number of hours to store the resource in the browser cache, starting nowpublic void setCacheDays(int days)
public CacheControl withDays(int days)
days
- the number of days to store the resource in the browser cache, starting nowpublic void setCacheYears(int years)
public CacheControl withYears(int years)
years
- the number of years to store the resource in the browser cache, starting nowpublic java.lang.Boolean getCacheNever()
public void setCacheNever()
public CacheControl never()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |