Top Description Constructors Methods
javax.portlet.filter

public Class ResourceResponseWrapper

extends MimeResponseWrapper
implements ResourceResponse
Class Inheritance
All Implemented Interfaces
javax.portlet.ResourceResponse, javax.portlet.MimeResponse, javax.portlet.PortletResponse
Imports
java.util.Locale, javax.portlet.ResourceResponse

The 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.
Since
2.0
See Also
ResourceResponse

Constructor Summary

AccessConstructor and Description
public
ResourceResponseWrapper(ResourceResponse
the event response to wrap
response
)

Creates an ResourceResponse adaptor wrapping the given response object.

Method Summary

Modifier and TypeMethod and Description
public ResourceResponse

Returns:

the wrapped response
getResponse
()

Overrides javax.portlet.filter.MimeResponseWrapper.getResponse.

Return the wrapped response object.
public int
getStatus()

Implements javax.portlet.ResourceResponse.getStatus.

Gets the current HTTP status code for the response.
public void
setCharacterEncoding(String
a String specifying only the character set defined by IANA Character Sets (http://www.iana.org/assignments/character-sets)
charset
)

Implements javax.portlet.ResourceResponse.setCharacterEncoding.

Sets the character encoding (MIME charset) of the response being sent to the client, for example, to UTF-8.
public void
setContentLength(int
an integer specifying the length of the content being returned; sets the Content-Length header
len
)

Implements javax.portlet.ResourceResponse.setContentLength.

Sets the length of the content body in the response.
public void
setContentLengthLong(long
a long specifying the length of the content being returned; sets the Content-Length header
len
)

Implements javax.portlet.ResourceResponse.setContentLengthLong.

Sets the length of the content body in the response.
public void
setLocale(Locale
the new locale of the response
loc
)

Implements javax.portlet.ResourceResponse.setLocale.

Sets the locale of the response, setting the headers (including the Content-Type's charset) as appropriate.
public void
setResponse(ResourceResponse
the response to set
response
)

Sets the response object being wrapped.

public void
setStatus(int
an integer specifying the status code for this request
sc
)

Implements javax.portlet.ResourceResponse.setStatus.

Sets the HTTP status code for this request.
Inherited from javax.portlet.filter.MimeResponseWrapper:
createActionURLcreateActionURLcreateRenderURLcreateRenderURLcreateResourceURLflushBuffergetBufferSizegetCacheControlgetCharacterEncodinggetContentTypegetLocalegetPortletOutputStreamgetWriterisCommittedresetresetBuffersetBufferSizesetContentTypesetResponse

Constructor Detail

ResourceResponseWrapperback to summary
public ResourceResponseWrapper(ResourceResponse response)

Creates an ResourceResponse adaptor wrapping the given response object.

Parameters
response:ResourceResponse

the event response to wrap

Exceptions
IllegalArgumentException:
if the response is null

Method Detail

getResponseback to summary
public ResourceResponse getResponse()

Overrides javax.portlet.filter.MimeResponseWrapper.getResponse.

Return the wrapped response object.

Returns:ResourceResponse

the wrapped response

getStatusback to summary
public int getStatus()

Implements javax.portlet.ResourceResponse.getStatus.

Doc from javax.portlet.ResourceResponse.getStatus.

Gets the current HTTP status code for the response.
Returns:int

The HTTP status code

Annotations
@Override
setCharacterEncodingback to summary
public void setCharacterEncoding(String charset)

Implements javax.portlet.ResourceResponse.setCharacterEncoding.

Doc from javax.portlet.ResourceResponse.setCharacterEncoding.

Sets the character encoding (MIME charset) of the response being sent to the client, for example, to UTF-8. If the character encoding has already been set by either the portlet container, setContentType(java.lang.String) or setLocale(java.util.Locale), this method overrides it. Calling setContentType(java.lang.String) with the String of text/html and calling this method with the String of UTF-8 is equivalent with calling setContentType with the String of text/html; charset=UTF-8.

This method can be called repeatedly to change the character encoding. This method has no effect if it is called after getWriter has been called or after the response has been committed.

Parameters
charset:String

a String specifying only the character set defined by IANA Character Sets (http://www.iana.org/assignments/character-sets)

Annotations
@Override
setContentLengthback to summary
public void setContentLength(int len)

Implements javax.portlet.ResourceResponse.setContentLength.

Doc from javax.portlet.ResourceResponse.setContentLength.

Sets the length of the content body in the response.

This method has no effect if it is called after the response has been committed.

Parameters
len:int

an integer specifying the length of the content being returned; sets the Content-Length header

Annotations
@Override
setContentLengthLongback to summary
public void setContentLengthLong(long len)

Implements javax.portlet.ResourceResponse.setContentLengthLong.

Doc from javax.portlet.ResourceResponse.setContentLengthLong.

Sets the length of the content body in the response.

This method has no effect if it is called after the response has been committed.

Parameters
len:long

a long specifying the length of the content being returned; sets the Content-Length header

Annotations
@Override
setLocaleback to summary
public void setLocale(Locale loc)

Implements javax.portlet.ResourceResponse.setLocale.

Doc from javax.portlet.ResourceResponse.setLocale.

Sets the locale of the response, setting the headers (including the Content-Type's charset) as appropriate. This method should be called before a call to getWriter(). By default, the response locale is the default locale provided by the portlet container.

This method has no effect if it is called after the response has been committed.

Parameters
loc:Locale

the new locale of the response

Annotations
@Override
setResponseback to summary
public void setResponse(ResourceResponse response)

Sets the response object being wrapped.

Parameters
response:ResourceResponse

the response to set

Exceptions
IllegalArgumentException:
if the response is null.
setStatusback to summary
public void setStatus(int sc)

Implements javax.portlet.ResourceResponse.setStatus.

Doc from javax.portlet.ResourceResponse.setStatus.

Sets the HTTP status code for this request.

The status code should be a valid value as defined in IETF rfc2616 "Hypertext Transfer Protocol -- HTTP/1.1" . The status code constants "SC_*" defined in javax.servlet.http.HttpServletResponse may be used.

This method has no effect if it is called after the response has been committed.

Parameters
sc:int

an integer specifying the status code for this request

Annotations
@Override