Class ClientDataRequestWrapper

    • Constructor Detail

      • ClientDataRequestWrapper

        public ClientDataRequestWrapper​(ClientDataRequest request)
        Parameters:
        request - the wrapped request
    • Method Detail

      • setRequest

        public void setRequest​(ClientDataRequest request)
        Sets the request object being wrapped.
        Parameters:
        request - the request to set
        Throws:
        IllegalArgumentException - if the request is null.
      • getPortletInputStream

        public InputStream getPortletInputStream()
                                          throws IOException
        Description copied from interface: ClientDataRequest
        Retrieves the body of the HTTP request from client to portal as binary data using an InputStream. Either this method or ClientDataRequest.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.

        Specified by:
        getPortletInputStream in interface ClientDataRequest
        Returns:
        an input stream containing the body of the request
        Throws:
        IOException - if an input or output exception occurred
      • getCharacterEncoding

        public String getCharacterEncoding()
        Description copied from interface: ClientDataRequest
        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.
        Specified by:
        getCharacterEncoding in interface ClientDataRequest
        Returns:
        a String containing the name of the character encoding, or null if the request does not specify a character encoding.
      • getContentType

        public String getContentType()
        Description copied from interface: ClientDataRequest
        Returns the MIME type of the body of the request, or null if the type is not known.
        Specified by:
        getContentType in interface ClientDataRequest
        Returns:
        a String containing the name of the MIME type of the request, or null if the type is not known.
      • getContentLength

        public int getContentLength()
        Description copied from interface: ClientDataRequest
        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.
        Specified by:
        getContentLength in interface ClientDataRequest
        Returns:
        an integer containing the length of the request body or -1 if the length is not known
      • getContentLengthLong

        public long getContentLengthLong()
        Description copied from interface: ClientDataRequest
        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.
        Specified by:
        getContentLengthLong in interface ClientDataRequest
        Returns:
        a long containing the length of the request body or -1 if the length is not known
      • getMethod

        public String getMethod()
        Description copied from interface: ClientDataRequest
        Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
        Specified by:
        getMethod in interface ClientDataRequest
        Returns:
        a String specifying the name of the HTTP method with which this request was made
      • getPart

        public jakarta.servlet.http.Part getPart​(String name)
                                          throws IOException,
                                                 PortletException
        Description copied from interface: ClientDataRequest
        Gets the Part with the given name.
        Specified by:
        getPart in interface ClientDataRequest
        Parameters:
        name - - the name of the requested Part
        Returns:
        The Part with the given name, or null if this request is of type multipart/form-data, but does not contain the requested Part
        Throws:
        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
      • getParts

        public Collection<jakarta.servlet.http.Part> getParts()
                                                       throws IOException,
                                                              PortletException
        Description copied from interface: ClientDataRequest
        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.

        Specified by:
        getParts in interface ClientDataRequest
        Returns:
        a (possibly empty) Collection of the Part components of this request
        Throws:
        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