Top Description Fields Constructors Methods
org.apache.tomcat.util.http.fileupload.servlet

public Class ServletRequestContext

extends Object
implements UploadContext
Class Inheritance
All Implemented Interfaces
org.apache.tomcat.util.http.fileupload.UploadContext, org.apache.tomcat.util.http.fileupload.RequestContext
Imports
java.io.IOException, .InputStream, jakarta.servlet.http.HttpServletRequest, org.apache.tomcat.util.http.fileupload.FileUploadBase, .UploadContext

Provides access to the request information needed for a request made to an HTTP servlet.

Since
FileUpload 1.1

Field Summary

Modifier and TypeField and Description
private final HttpServletRequest
request

The request for which the context is being provided.

Constructor Summary

AccessConstructor and Description
public
ServletRequestContext(final HttpServletRequest
The request to which this context applies.
request
)

Construct a context for this request.

Method Summary

Modifier and TypeMethod and Description
public long

Returns:

The content length of the request.
contentLength
()

Implements org.apache.tomcat.util.http.fileupload.UploadContext.contentLength.

Retrieve the content length of the request.

public String

Returns:

The character encoding for the request.
getCharacterEncoding
()

Implements org.apache.tomcat.util.http.fileupload.RequestContext.getCharacterEncoding.

Retrieve the character encoding for the request.

public String

Returns:

The content type of the request.
getContentType
()

Implements org.apache.tomcat.util.http.fileupload.RequestContext.getContentType.

Retrieve the content type of the request.

public InputStream

Returns:

The input stream for the request.
getInputStream
()

Implements org.apache.tomcat.util.http.fileupload.RequestContext.getInputStream.

Retrieve the input stream for the request.

public String

Returns:

a string representation of this object.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of this object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

requestback to summary
private final HttpServletRequest request

The request for which the context is being provided.

Constructor Detail

ServletRequestContextback to summary
public ServletRequestContext(final HttpServletRequest request)

Construct a context for this request.

Parameters
request:HttpServletRequest

The request to which this context applies.

Method Detail

contentLengthback to summary
public long contentLength()

Implements org.apache.tomcat.util.http.fileupload.UploadContext.contentLength.

Retrieve the content length of the request.

Returns:long

The content length of the request.

Annotations
@Override
Since
1.3
getCharacterEncodingback to summary
public String getCharacterEncoding()

Implements org.apache.tomcat.util.http.fileupload.RequestContext.getCharacterEncoding.

Retrieve the character encoding for the request.

Returns:String

The character encoding for the request.

Annotations
@Override
getContentTypeback to summary
public String getContentType()

Implements org.apache.tomcat.util.http.fileupload.RequestContext.getContentType.

Retrieve the content type of the request.

Returns:String

The content type of the request.

Annotations
@Override
getInputStreamback to summary
public InputStream getInputStream() throws IOException

Implements org.apache.tomcat.util.http.fileupload.RequestContext.getInputStream.

Retrieve the input stream for the request.

Returns:InputStream

The input stream for the request.

Annotations
@Override
Exceptions
IOException:
if a problem occurs.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this object.

Returns:String

a string representation of this object.

Annotations
@Override