|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wicket.request.resource.AbstractResource.ResourceResponse
public static class AbstractResource.ResourceResponse
Represents data used to configure response and write resource data.
Constructor Summary | |
---|---|
AbstractResource.ResourceResponse()
Construct. |
Method Summary | |
---|---|
boolean |
dataNeedsToBeWritten(IResource.Attributes attributes)
Check to determine if the resource data needs to be written. |
long |
getCacheDuration()
|
ContentDisposition |
getContentDisposition()
|
long |
getContentLength()
|
java.lang.String |
getContentType()
|
java.lang.Integer |
getErrorCode()
|
java.lang.String |
getFileName()
|
java.util.Date |
getLastModified()
|
protected java.lang.String |
getTextEncoding()
|
AbstractResource.WriteCallback |
getWriteCallback()
|
boolean |
isCacheable()
|
void |
setCacheable(boolean cacheable)
Cachable resources are cached on client. |
void |
setCacheDuration(long cacheDuration)
Sets the duration for which this resource should be cached on client (in seconds). |
void |
setContentDisposition(ContentDisposition contentDisposition)
Determines whether the resource will be inline or an attachment. |
void |
setContentLength(long contentLength)
Sets the content length (in bytes) of the data. |
void |
setContentType(java.lang.String contentType)
Sets the content type for the resource. |
void |
setErrorCode(java.lang.Integer errorCode)
Sets the error code for resource. |
void |
setFileName(java.lang.String fileName)
Sets the file name of the resource. |
void |
setLastModified(java.util.Date lastModified)
Sets the last modified data of the resource. |
void |
setTextEncoding(java.lang.String textEncoding)
Sets the text encoding for the resource. |
void |
setWriteCallback(AbstractResource.WriteCallback writeCallback)
Sets the AbstractResource.WriteCallback . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractResource.ResourceResponse()
Method Detail |
---|
public void setErrorCode(java.lang.Integer errorCode)
errorCode
- public java.lang.Integer getErrorCode()
null
public void setFileName(java.lang.String fileName)
fileName
- public java.lang.String getFileName()
public void setContentDisposition(ContentDisposition contentDisposition)
contentDisposition
- ContentDisposition
public ContentDisposition getContentDisposition()
public void setContentType(java.lang.String contentType)
contentType
- public java.lang.String getContentType()
public void setTextEncoding(java.lang.String textEncoding)
textEncoding
- protected java.lang.String getTextEncoding()
public void setContentLength(long contentLength)
contentLength
- public long getContentLength()
public void setLastModified(java.util.Date lastModified)
If-Modified-Since
to determine if the actuall data really needs to be sent
to client.
lastModified
- public java.util.Date getLastModified()
public boolean dataNeedsToBeWritten(IResource.Attributes attributes)
If-Modified-Since
request header and compares it to lastModified property.
In order for this method to work setLastModified(Date)
has to be called first.
attributes
-
true
if the resource data does need to be written,
false
otherwise.public void setCacheable(boolean cacheable)
Expires
and
Cache-Control
headers.
cacheable
- #setCacheDuration(int)
public boolean isCacheable()
public void setCacheDuration(long cacheDuration)
IResourceSettings.setDefaultCacheDuration(int)
cacheDuration
- public long getCacheDuration()
public void setWriteCallback(AbstractResource.WriteCallback writeCallback)
AbstractResource.WriteCallback
. The callback is responsible for generating the response
data.
It is necessary to set the AbstractResource.WriteCallback
if
#dataNeedsToBeWritten(org.apache.wicket.ng.resource.IResource.Attributes)
returns
true
and setErrorCode(Integer)
has not been called.
writeCallback
- public AbstractResource.WriteCallback getWriteCallback()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |