Top Description Constructors Methods
javax.portlet.filter

public Class ClientDataRequestWrapper

extends PortletRequestWrapper
implements ClientDataRequest
Class Inheritance
All Implemented Interfaces
javax.portlet.ClientDataRequest, javax.portlet.PortletRequest, javax.portlet.RenderState
Known Direct Subclasses
javax.portlet.filter.ResourceRequestWrapper, javax.portlet.filter.ActionRequestWrapper
Imports
java.io.BufferedReader, .IOException, .InputStream, .UnsupportedEncodingException, java.util.Collection, javax.portlet.ClientDataRequest, .PortletException, javax.servlet.http.Part

The ClientDataRequestWrapper provides a convenient implementation of the ClientDataRequest interface that can be subclassed by developers. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped request object.
Since
3.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getCharacterEncoding()

Implements javax.portlet.ClientDataRequest.getCharacterEncoding.

Returns the name of the character encoding used in the body of this request.
public int
getContentLength()

Implements javax.portlet.ClientDataRequest.getContentLength.

Returns the length, in bytes, of the request body which is made available by the input stream, or -1 if the length is not known.
public long
getContentLengthLong()

Implements javax.portlet.ClientDataRequest.getContentLengthLong.

Returns the length, in bytes, of the request body which is made available by the input stream, or -1 if the length is not known.
public String
getContentType()

Implements javax.portlet.ClientDataRequest.getContentType.

Returns the MIME type of the body of the request, or null if the type is not known.
public String
getMethod()

Implements javax.portlet.ClientDataRequest.getMethod.

Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
public Part
getPart(String
- the name of the requested Part
name
)

Implements javax.portlet.ClientDataRequest.getPart.

Gets the Part with the given name.
public Collection<Part>
getParts()

Implements javax.portlet.ClientDataRequest.getParts.

Gets all the Part components of this request, provided that it is of type multipart/form-data.
public InputStream
getPortletInputStream()

Implements javax.portlet.ClientDataRequest.getPortletInputStream.

Retrieves the body of the HTTP request from client to portal as binary data using an InputStream.
public BufferedReader
getReader()

Implements javax.portlet.ClientDataRequest.getReader.

Retrieves the body of the HTTP request from the client to the portal as character data using a BufferedReader.
public ClientDataRequest

Returns:

the wrapped request
getRequest
()

Overrides javax.portlet.filter.PortletRequestWrapper.getRequest.

Return the wrapped request object.
public void
setCharacterEncoding(String
a String containing the name of the character encoding.
enc
)

Implements javax.portlet.ClientDataRequest.setCharacterEncoding.

Overrides the name of the character encoding used in the body of this request.
public void
setRequest(ClientDataRequest
the request to set
request
)

Sets the request object being wrapped.

Inherited from javax.portlet.filter.PortletRequestWrapper:
getAttributegetAttributeNamesgetAuthTypegetContextPathgetCookiesgetLocalegetLocalesgetParametergetParameterMapgetParameterNamesgetParameterValuesgetPortalContextgetPortletContextgetPortletModegetPortletSessiongetPortletSessiongetPreferencesgetPrivateParameterMapgetPropertiesgetPropertygetPropertyNamesgetPublicParameterMapgetRemoteUsergetRenderParametersgetRequestedSessionIdgetResponseContentTypegetResponseContentTypesgetSchemegetServerNamegetServerPortgetUserAgentgetUserPrincipalgetWindowIDgetWindowStateisPortletModeAllowedisRequestedSessionIdValidisSecureisUserInRoleisWindowStateAllowedremoveAttributesetAttributesetRequest

Constructor Detail

ClientDataRequestWrapperback to summary
public ClientDataRequestWrapper(ClientDataRequest request)

Method Detail

getCharacterEncodingback to summary
public String getCharacterEncoding()

Implements javax.portlet.ClientDataRequest.getCharacterEncoding.

Doc from javax.portlet.ClientDataRequest.getCharacterEncoding.

Returns the name of the character encoding used in the body of this request. This method returns null if the request does not specify a character encoding.

Returns:String

a String containing the name of the character encoding, or null if the request does not specify a character encoding.

getContentLengthback to summary
public int getContentLength()

Implements javax.portlet.ClientDataRequest.getContentLength.

Doc from javax.portlet.ClientDataRequest.getContentLength.

Returns the length, in bytes, of the request body which is made available by the input stream, or -1 if the length is not known.

Returns:int

an integer containing the length of the request body or -1 if the length is not known

getContentLengthLongback to summary
public long getContentLengthLong()

Implements javax.portlet.ClientDataRequest.getContentLengthLong.

Doc from javax.portlet.ClientDataRequest.getContentLengthLong.

Returns the length, in bytes, of the request body which is made available by the input stream, or -1 if the length is not known.
Returns:long

a long containing the length of the request body or -1 if the length is not known

Annotations
@Override
getContentTypeback to summary
public String getContentType()

Implements javax.portlet.ClientDataRequest.getContentType.

Doc from javax.portlet.ClientDataRequest.getContentType.

Returns the MIME type of the body of the request, or null if the type is not known.

Returns:String

a String containing the name of the MIME type of the request, or null if the type is not known.

getMethodback to summary
public String getMethod()

Implements javax.portlet.ClientDataRequest.getMethod.

Doc from javax.portlet.ClientDataRequest.getMethod.

Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.

Returns:String

a String specifying the name of the HTTP method with which this request was made

getPartback to summary
public Part getPart(String name) throws IOException, PortletException

Implements javax.portlet.ClientDataRequest.getPart.

Doc from javax.portlet.ClientDataRequest.getPart.

Gets the Part with the given name.
Parameters
name:String

- the name of the requested Part

Returns:Part

The Part with the given name, or null if this request is of type multipart/form-data, but does not contain the requested Part

Annotations
@Override
Exceptions
IOException:
if an I/O error occurred during the retrieval of the Part components of this request
PortletException:
if this request is not of type multipart/form-data
getPartsback to summary
public Collection<Part> getParts() throws IOException, PortletException

Implements javax.portlet.ClientDataRequest.getParts.

Doc from javax.portlet.ClientDataRequest.getParts.

Gets all the Part components of this request, provided that it is of type multipart/form-data.

If this request is of type multipart/form-data, but does not contain any Part components, the returned Collection will be empty.

Any changes to the returned Collection must not affect this request object.

Returns:Collection<Part>

a (possibly empty) Collection of the Part components of this request

Annotations
@Override
Exceptions
IOException:
if an I/O error occurred during the retrieval of the Part components of this request
PortletException:
if this request is not of type multipart/form-data
getPortletInputStreamback to summary
public InputStream getPortletInputStream() throws IOException

Implements javax.portlet.ClientDataRequest.getPortletInputStream.

Doc from javax.portlet.ClientDataRequest.getPortletInputStream.

Retrieves the body of the HTTP request from client to portal as binary data using an InputStream. Either this method or getReader may be called to read the body, but not both.

For HTTP POST data of type application/x-www-form-urlencoded this method throws an IllegalStateException as this data has been already processed by the portal/portlet-container and is available as request parameters.

Returns:InputStream

an input stream containing the body of the request

Exceptions
IOException:
if an input or output exception occurred
getReaderback to summary
public BufferedReader getReader() throws UnsupportedEncodingException, IOException

Implements javax.portlet.ClientDataRequest.getReader.

Doc from javax.portlet.ClientDataRequest.getReader.

Retrieves the body of the HTTP request from the client to the portal as character data using a BufferedReader. The reader translates the character data according to the character encoding used on the body. Either this method or getPortletInputStream may be called to read the body, not both.

For HTTP POST data of type application/x-www-form-urlencoded this method throws an IllegalStateException as this data has been already processed by the portal/portlet-container and is available as request parameters.

Returns:BufferedReader

a BufferedReader containing the body of the request

Exceptions
UnsupportedEncodingException:
if the character set encoding used is not supported and the text cannot be decoded
IOException:
if an input or output exception occurred
getRequestback to summary
public ClientDataRequest getRequest()

Overrides javax.portlet.filter.PortletRequestWrapper.getRequest.

Return the wrapped request object.

Returns:ClientDataRequest

the wrapped request

setCharacterEncodingback to summary
public void setCharacterEncoding(String enc) throws UnsupportedEncodingException

Implements javax.portlet.ClientDataRequest.setCharacterEncoding.

Doc from javax.portlet.ClientDataRequest.setCharacterEncoding.

Overrides the name of the character encoding used in the body of this request. This method must be called prior to reading input using getReader or getPortletInputStream.

This method only sets the character set for the Reader that the getReader method returns.

Parameters
enc:String

a String containing the name of the character encoding.

Exceptions
UnsupportedEncodingException:
if this is not a valid encoding
setRequestback to summary
public void setRequest(ClientDataRequest request)

Sets the request object being wrapped.

Parameters
request:ClientDataRequest

the request to set

Exceptions
IllegalArgumentException:
if the request is null.