Class ServletRequestContext
java.lang.Object
org.apache.tomcat.util.http.fileupload.servlet.ServletRequestContext
- All Implemented Interfaces:
RequestContext
,UploadContext
Provides access to the request information needed for a request made to an HTTP servlet.
- Since:
- FileUpload 1.1
-
Constructor Summary
ConstructorDescriptionServletRequestContext
(HttpServletRequest request) Construct a context for this request. -
Method Summary
Modifier and TypeMethodDescriptionlong
Retrieve the content length of the request.Retrieve the character encoding for the request.Retrieve the content type of the request.Retrieve the input stream for the request.toString()
Returns a string representation of this object.
-
Constructor Details
-
ServletRequestContext
Construct a context for this request.- Parameters:
request
- The request to which this context applies.
-
-
Method Details
-
getCharacterEncoding
Retrieve the character encoding for the request.- Specified by:
getCharacterEncoding
in interfaceRequestContext
- Returns:
- The character encoding for the request.
-
getContentType
Retrieve the content type of the request.- Specified by:
getContentType
in interfaceRequestContext
- Returns:
- The content type of the request.
-
contentLength
public long contentLength()Retrieve the content length of the request.- Specified by:
contentLength
in interfaceUploadContext
- Returns:
- The content length of the request.
- Since:
- FileUpload 1.3
-
getInputStream
Retrieve the input stream for the request.- Specified by:
getInputStream
in interfaceRequestContext
- Returns:
- The input stream for the request.
- Throws:
IOException
- if a problem occurs.
-
toString
Returns a string representation of this object.
-