Class AbstractRequestContext<T>

java.lang.Object
org.apache.commons.fileupload2.core.AbstractRequestContext<T>
All Implemented Interfaces:
RequestContext
Direct Known Subclasses:
JakartaServletRequestContext, JavaxServletRequestContext

public abstract class AbstractRequestContext<T> extends Object implements RequestContext
  • Field Details

    • contentLengthDefault

      private final LongSupplier contentLengthDefault
      Supplies the content length default.
    • contentLengthString

      private final Function<String,String> contentLengthString
      Supplies the content length string.
    • request

      private final T request
      The request.
  • 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.