Class AbstractRequestContext<T>
- java.lang.Object
-
- org.apache.commons.fileupload2.core.AbstractRequestContext<T>
-
- Type Parameters:
T- The request type.
- All Implemented Interfaces:
RequestContext
public abstract class AbstractRequestContext<T> extends java.lang.Object implements RequestContext
Abstracts a RequestContext for implementations.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRequestContext(java.util.function.Function<java.lang.String,java.lang.String> contentLengthString, java.util.function.LongSupplier contentLengthDefault, T request)Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetContentLength()Gets the content length of the request.TgetRequest()Gets the request.booleanisMultipartRelated()Tests whether the Request of typemultipart/related?java.lang.StringtoString()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 Detail
-
AbstractRequestContext
protected AbstractRequestContext(java.util.function.Function<java.lang.String,java.lang.String> contentLengthString, java.util.function.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 Detail
-
getContentLength
public long getContentLength()
Gets the content length of the request.- Specified by:
getContentLengthin interfaceRequestContext- Returns:
- The content length of the request.
-
getRequest
public T getRequest()
Gets the request.- Returns:
- the request.
-
isMultipartRelated
public boolean isMultipartRelated()
Tests whether the Request of typemultipart/related?- Specified by:
isMultipartRelatedin interfaceRequestContext- Returns:
- whether the Request is of type
multipart/related - Since:
- 2.0.0
-
toString
public java.lang.String toString()
Returns a string representation of this object.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of this object.
-
-