# Class JakartaServletRequestContext

java.lang.Object
org.apache.commons.fileupload2.core.AbstractRequestContext<jakarta.servlet.http.HttpServletRequest>
org.apache.commons.fileupload2.jakarta.servlet6.JakartaServletRequestContext

All Implemented Interfaces:
  `RequestContext`

public class JakartaServletRequestContext extends AbstractRequestContext<jakarta.servlet.http.HttpServletRequest>
Provides access to the request information needed for a request made to an HTTP servlet.

## Constructor Summary

Constructors
Constructor
Description
`JakartaServletRequestContext(jakarta.servlet.http.HttpServletRequest request)`
Constructs a context for this request.

## Method Summary

Modifier and Type
Method
Description
`String`
`getCharacterEncoding()`
Gets the character encoding for the request.
`String`
`getContentType()`
Gets the content type of the request.
`InputStream`
`getInputStream()`
Gets the input stream for the request.

### Methods inherited from class AbstractRequestContext

`getContentLength, getRequest, isMultipartRelated, toString`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface RequestContext

`getCharset`

## Constructor Details

### JakartaServletRequestContext

public JakartaServletRequestContext(jakarta.servlet.http.HttpServletRequest request)
Constructs a context for this request.

Parameters:
  `request` - The request to which this context applies.

## Method Details

### getCharacterEncoding

public String getCharacterEncoding()
Gets the character encoding for the request.

Returns:
  The character encoding for the request.

### getContentType

public String getContentType()
Gets the content type of the request.

Returns:
  The content type of the request.

### getInputStream

public InputStream getInputStream() throws IOException
Gets the input stream for the request.

Returns:
  The input stream for the request.
Throws:
  `IOException` - if a problem occurs.