Class ServletRequestContext
- java.lang.Object
-
- org.apache.tomcat.util.http.fileupload.servlet.ServletRequestContext
-
- All Implemented Interfaces:
RequestContext,UploadContext
public class ServletRequestContext extends Object implements UploadContext
Provides access to the request information needed for a request made to an HTTP servlet.
- Since:
- FileUpload 1.1
-
-
Constructor Summary
Constructors Constructor Description ServletRequestContext(HttpServletRequest request)Construct a context for this request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcontentLength()Retrieve the content length of the request.StringgetCharacterEncoding()Retrieve the character encoding for the request.StringgetContentType()Retrieve the content type of the request.InputStreamgetInputStream()Retrieve the input stream for the request.StringtoString()Returns a string representation of this object.
-
-
-
Constructor Detail
-
ServletRequestContext
public ServletRequestContext(HttpServletRequest 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:
getCharacterEncodingin interfaceRequestContext- Returns:
- The character encoding for the request.
-
getContentType
public String getContentType()
Retrieve the content type of the request.- Specified by:
getContentTypein interfaceRequestContext- Returns:
- The content type of the request.
-
contentLength
public long contentLength()
Retrieve the content length of the request.- Specified by:
contentLengthin interfaceUploadContext- 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:
getInputStreamin interfaceRequestContext- Returns:
- The input stream for the request.
- Throws:
IOException- if a problem occurs.
-
-