org.apache.commons.fileupload.portlet

## Class PortletRequestContext

- java.lang.Object
- - org.apache.commons.fileupload.portlet.PortletRequestContext

- All Implemented Interfaces:
    RequestContext, UploadContext

      public class PortletRequestContext
      extends Object
      implements UploadContext

  Provides access to the request information needed for a request made to a portlet.

  Since:
    FileUpload 1.1

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PortletRequestContext(javax.portlet.ActionRequest request)` Construct a context for this request.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `contentLength()` Retrieve the content length of the request.
    `String` | `getCharacterEncoding()` Retrieve the character encoding for the request.
    `int` | `getContentLength()` Deprecated. 1.3 Use `contentLength()` instead
    `String` | `getContentType()` Retrieve the content type of the request.
    `InputStream` | `getInputStream()` Retrieve the input stream for the request.
    `String` | `toString()` Returns a string representation of this object.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### PortletRequestContext

          public PortletRequestContext(javax.portlet.ActionRequest request)

      Construct a context for this request.
      Parameters:
        `request` - The request to which this context applies.

  - ### Method Detail

    - #### getCharacterEncoding

          public String getCharacterEncoding()

      Retrieve the character encoding for the request.
      Specified by:
        `getCharacterEncoding` in interface `RequestContext`
      Returns:
        The character encoding for the request.

    - #### getContentType

          public String getContentType()

      Retrieve the content type of the request.
      Specified by:
        `getContentType` in interface `RequestContext`
      Returns:
        The content type of the request.

    - #### getContentLength

          @Deprecated
          public int getContentLength()

      Deprecated. 1.3 Use `contentLength()` instead
      Retrieve the content length of the request.
      Specified by:
        `getContentLength` in interface `RequestContext`
      Returns:
        The content length of the request.

    - #### contentLength

          public long contentLength()

      Retrieve the content length of the request.
      Specified by:
        `contentLength` in interface `UploadContext`
      Returns:
        The content length of the request.
      Since:
        1.3

    - #### getInputStream

          public InputStream getInputStream()
                                     throws IOException

      Retrieve the input stream for the request.
      Specified by:
        `getInputStream` in interface `RequestContext`
      Returns:
        The input stream for the request.
      Throws:
        `IOException` - if a problem occurs.

    - #### toString

          public String toString()

      Returns a string representation of this object.
      Overrides:
        `toString` in class `Object`
      Returns:
        a string representation of this object.

Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.