public class ResourceResponseWrapper extends MimeResponseWrapper implements ResourceResponse
ResourceResponseWrapper provides a convenient
implementation of the ResourceResponse interface
that can be subclassed by developers.
This class implements the Wrapper or Decorator pattern.
Methods default to calling through to the wrapped response object.ResourceResponseMimeResponse.CopyHTTP_STATUS_CODECACHE_SCOPE, ETAG, EXPIRATION_CACHE, MARKUP_HEAD_ELEMENT, NAMESPACED_RESPONSE, PRIVATE_SCOPE, PUBLIC_SCOPE, USE_CACHED_CONTENT| Constructor and Description |
|---|
ResourceResponseWrapper(ResourceResponse response)
Creates an
ResourceResponse adaptor
wrapping the given response object. |
| Modifier and Type | Method and Description |
|---|---|
ResourceResponse |
getResponse()
Return the wrapped response object.
|
int |
getStatus()
Gets the current HTTP status code for the response.
|
void |
setCharacterEncoding(String charset)
The default behavior of this method is to call
setCharacterEncoding(String charset) on the wrapped response object. |
void |
setContentLength(int len)
The default behavior of this method is to call
setContentLength() on the wrapped response object. |
void |
setContentLengthLong(long len)
Sets the length of the content body in the response.
|
void |
setLocale(Locale loc)
The default behavior of this method is to call
setLocale(Locale loc) on the wrapped response object. |
void |
setResponse(ResourceResponse response)
Sets the response object being wrapped.
|
void |
setStatus(int sc)
The default behavior of this method is to call
setStatus() on the wrapped response object. |
createActionURL, createActionURL, createRenderURL, createRenderURL, createResourceURL, flushBuffer, getBufferSize, getCacheControl, getCharacterEncoding, getContentType, getLocale, getPortletOutputStream, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setContentType, setResponseaddProperty, addProperty, addProperty, createElement, encodeURL, getNamespace, getProperty, getPropertyNames, getPropertyValues, setProperty, setResponseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateActionURL, createActionURL, createRenderURL, createRenderURL, createResourceURLflushBuffer, getBufferSize, getCacheControl, getCharacterEncoding, getContentType, getLocale, getPortletOutputStream, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setContentTypeaddProperty, addProperty, addProperty, createElement, encodeURL, getNamespace, getProperty, getPropertyNames, getPropertyValues, setPropertypublic ResourceResponseWrapper(ResourceResponse response)
ResourceResponse adaptor
wrapping the given response object.response - the event response to wrapIllegalArgumentException - if the response is nullpublic ResourceResponse getResponse()
getResponse in class MimeResponseWrapperpublic void setResponse(ResourceResponse response)
response - the response to setIllegalArgumentException - if the response is null.public void setCharacterEncoding(String charset)
setCharacterEncoding(String charset) on the wrapped response object.setCharacterEncoding in interface ResourceResponsecharset - a String specifying only the character set defined by
IANA Character Sets (http://www.iana.org/assignments/character-sets)public void setLocale(Locale loc)
setLocale(Locale loc) on the wrapped response object.setLocale in interface ResourceResponseloc - the new locale of the responsepublic void setContentLength(int len)
setContentLength() on the wrapped response object.setContentLength in interface ResourceResponselen - an integer specifying the length of the content being returned; sets the Content-Length headerpublic void setStatus(int sc)
setStatus() on the wrapped response object.
setStatus in interface ResourceResponsesc - an integer specifying the status code for this requestHttpServletResponse,
HttpServletResponse.setStatus(int)public int getStatus()
ResourceResponsegetStatus in interface ResourceResponseHttpServletResponse,
HttpServletResponse.getStatus()public void setContentLengthLong(long len)
ResourceResponseThis method has no effect if it is called after the response has been committed.
setContentLengthLong in interface ResourceResponselen - a long specifying the length of the content being returned; sets the Content-Length headerJava Portlet 3.0 API Specification. See the Copyright and License provided with this distribution. Use is subject to license terms.