Package org.apache.commons.fileupload2.core

# Class AbstractRequestContext<T>

java.lang.Object
org.apache.commons.fileupload2.core.AbstractRequestContext<T>

All Implemented Interfaces:
  `RequestContext`

Direct Known Subclasses:
  `JakartaServletRequestContext`, `JakartaServletRequestContext`, `JavaxPortletRequestContext`, `JavaxServletRequestContext`

public abstract class AbstractRequestContext<T> extends Object implements RequestContext

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `AbstractRequestContext(Function<String,String> contentLengthString, LongSupplier contentLengthDefault, T request)`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `getContentLength()`
  Gets the content length of the request.
  `T`
  `getRequest()`
  `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`

  ### Methods inherited from interface org.apache.commons.fileupload2.core.RequestContext

  `getCharacterEncoding, getCharset, getContentType, getInputStream`

- ## Constructor Details

  - ### AbstractRequestContext

    protected AbstractRequestContext(Function<String,String> contentLengthString, LongSupplier contentLengthDefault, T request)
    Constructs a new instance.
    Parameters:
      `contentLengthString` - How to get the content length string.
      `contentLengthDefault` - How to get the content length default.
      `request` - The request.

- ## Method Details

  - ### getContentLength

    public long getContentLength()
    Gets the content length of the request.
    Specified by:
      `getContentLength` in interface `RequestContext`
    Returns:
      The content length of the request.

  - ### getRequest

    public T getRequest()

  - ### toString

    public String toString()
    Returns a string representation of this object.
    Overrides:
      `toString` in class `Object`
    Returns:
      a string representation of this object.