Class ServletRequestContext
- java.lang.Object
-
- org.apache.commons.fileupload.servlet.ServletRequestContext
-
- All Implemented Interfaces:
RequestContext
public class ServletRequestContext extends java.lang.Object implements RequestContext
Provides access to the request information needed for a request made to an HTTP servlet.
- Since:
- FileUpload 1.1
- Version:
- $Id: ServletRequestContext.java 349393 2005-11-28 06:36:35Z martinc $
- Author:
- Martin Cooper
-
-
Field Summary
Fields Modifier and Type Field Description private javax.servlet.http.HttpServletRequest
request
The request for which the context is being provided.
-
Constructor Summary
Constructors Constructor Description ServletRequestContext(javax.servlet.http.HttpServletRequest request)
Construct a context for this request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCharacterEncoding()
Retrieve the character encoding for the request.int
getContentLength()
Retrieve the content length of the request.java.lang.String
getContentType()
Retrieve the content type of the request.java.io.InputStream
getInputStream()
Retrieve the input stream for the request.java.lang.String
toString()
Returns a string representation of this object.
-
-
-
Method Detail
-
getCharacterEncoding
public java.lang.String getCharacterEncoding()
Retrieve the character encoding for the request.- Specified by:
getCharacterEncoding
in interfaceRequestContext
- Returns:
- The character encoding for the request.
-
getContentType
public java.lang.String getContentType()
Retrieve the content type of the request.- Specified by:
getContentType
in interfaceRequestContext
- Returns:
- The content type of the request.
-
getContentLength
public int getContentLength()
Retrieve the content length of the request.- Specified by:
getContentLength
in interfaceRequestContext
- Returns:
- The content length of the request.
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
Retrieve the input stream for the request.- Specified by:
getInputStream
in interfaceRequestContext
- Returns:
- The input stream for the request.
- Throws:
java.io.IOException
- if a problem occurs.
-
toString
public java.lang.String toString()
Returns a string representation of this object.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of this object.
-
-