Class JakartaMockServletHttpRequest
java.lang.Object
org.apache.commons.fileupload2.jakarta.servlet6.JakartaMockServletHttpRequest
- All Implemented Interfaces:
HttpServletRequest
,ServletRequest
-
Field Summary
Fields inherited from interface jakarta.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
-
Constructor Summary
ConstructorDescriptionJakartaMockServletHttpRequest
(byte[] requestData, String strContentType) Creates a new instance with the given request data and content type.JakartaMockServletHttpRequest
(InputStream requestData, long requestLength, String strContentType) Creates a new instance with the given request data and content type. -
Method Summary
Modifier and TypeMethodDescriptionboolean
authenticate
(HttpServletResponse response) getAttribute
(String arg0) int
long
Cookie[]
long
getDateHeader
(String arg0) getHeaders
(String arg0) int
getIntHeader
(String arg0) int
getParameter
(String arg0) String[]
getParameterValues
(String arg0) getParts()
int
getRequestDispatcher
(String arg0) int
getSession
(boolean arg0) boolean
boolean
boolean
boolean
boolean
boolean
isSecure()
boolean
isUserInRole
(String arg0) void
void
logout()
void
removeAttribute
(String arg0) void
setAttribute
(String arg0, Object arg1) void
setCharacterEncoding
(String arg0) void
setContentLength
(long length) For testing attack scenarios in SizesTest.void
setReadLimit
(int readLimit) Sets the read limit.startAsync
(ServletRequest servletRequest, ServletResponse servletResponse) <T extends HttpUpgradeHandler>
TMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jakarta.servlet.http.HttpServletRequest
getHttpServletMapping, getTrailerFields, isTrailerFieldsReady, newPushBuilder
-
Constructor Details
-
JakartaMockServletHttpRequest
Creates a new instance with the given request data and content type. -
JakartaMockServletHttpRequest
public JakartaMockServletHttpRequest(InputStream requestData, long requestLength, String strContentType) Creates a new instance with the given request data and content type.
-
-
Method Details
-
authenticate
- Specified by:
authenticate
in interfaceHttpServletRequest
- Throws:
IOException
ServletException
-
changeSessionId
- Specified by:
changeSessionId
in interfaceHttpServletRequest
-
getAsyncContext
- Specified by:
getAsyncContext
in interfaceServletRequest
-
getAttribute
- Specified by:
getAttribute
in interfaceServletRequest
- See Also:
-
getAttributeNames
- Specified by:
getAttributeNames
in interfaceServletRequest
- See Also:
-
getAuthType
- Specified by:
getAuthType
in interfaceHttpServletRequest
- See Also:
-
getCharacterEncoding
- Specified by:
getCharacterEncoding
in interfaceServletRequest
- See Also:
-
getContentLength
- Specified by:
getContentLength
in interfaceServletRequest
- See Also:
-
getContentLengthLong
- Specified by:
getContentLengthLong
in interfaceServletRequest
-
getContentType
- Specified by:
getContentType
in interfaceServletRequest
- See Also:
-
getContextPath
- Specified by:
getContextPath
in interfaceHttpServletRequest
- See Also:
-
getCookies
- Specified by:
getCookies
in interfaceHttpServletRequest
- See Also:
-
getDateHeader
- Specified by:
getDateHeader
in interfaceHttpServletRequest
- See Also:
-
getDispatcherType
- Specified by:
getDispatcherType
in interfaceServletRequest
-
getHeader
- Specified by:
getHeader
in interfaceHttpServletRequest
- See Also:
-
getHeaderNames
- Specified by:
getHeaderNames
in interfaceHttpServletRequest
- See Also:
-
getHeaders
- Specified by:
getHeaders
in interfaceHttpServletRequest
- See Also:
-
getInputStream
- Specified by:
getInputStream
in interfaceServletRequest
- Throws:
IOException
- See Also:
-
getIntHeader
- Specified by:
getIntHeader
in interfaceHttpServletRequest
- See Also:
-
getLocalAddr
- Specified by:
getLocalAddr
in interfaceServletRequest
- See Also:
-
getLocale
- Specified by:
getLocale
in interfaceServletRequest
- See Also:
-
getLocales
- Specified by:
getLocales
in interfaceServletRequest
- See Also:
-
getLocalName
- Specified by:
getLocalName
in interfaceServletRequest
- See Also:
-
getLocalPort
- Specified by:
getLocalPort
in interfaceServletRequest
- See Also:
-
getMethod
- Specified by:
getMethod
in interfaceHttpServletRequest
- See Also:
-
getParameter
- Specified by:
getParameter
in interfaceServletRequest
- See Also:
-
getParameterMap
- Specified by:
getParameterMap
in interfaceServletRequest
- See Also:
-
getParameterNames
- Specified by:
getParameterNames
in interfaceServletRequest
- See Also:
-
getParameterValues
- Specified by:
getParameterValues
in interfaceServletRequest
- See Also:
-
getPart
- Specified by:
getPart
in interfaceHttpServletRequest
- Throws:
IOException
ServletException
-
getParts
- Specified by:
getParts
in interfaceHttpServletRequest
- Throws:
IOException
ServletException
-
getPathInfo
- Specified by:
getPathInfo
in interfaceHttpServletRequest
- See Also:
-
getPathTranslated
- Specified by:
getPathTranslated
in interfaceHttpServletRequest
- See Also:
-
getProtocol
- Specified by:
getProtocol
in interfaceServletRequest
- See Also:
-
getProtocolRequestId
- Specified by:
getProtocolRequestId
in interfaceServletRequest
-
getQueryString
- Specified by:
getQueryString
in interfaceHttpServletRequest
- See Also:
-
getReader
- Specified by:
getReader
in interfaceServletRequest
- Throws:
IOException
- See Also:
-
getRemoteAddr
- Specified by:
getRemoteAddr
in interfaceServletRequest
- See Also:
-
getRemoteHost
- Specified by:
getRemoteHost
in interfaceServletRequest
- See Also:
-
getRemotePort
- Specified by:
getRemotePort
in interfaceServletRequest
- See Also:
-
getRemoteUser
- Specified by:
getRemoteUser
in interfaceHttpServletRequest
- See Also:
-
getRequestDispatcher
- Specified by:
getRequestDispatcher
in interfaceServletRequest
- See Also:
-
getRequestedSessionId
- Specified by:
getRequestedSessionId
in interfaceHttpServletRequest
- See Also:
-
getRequestId
- Specified by:
getRequestId
in interfaceServletRequest
-
getRequestURI
- Specified by:
getRequestURI
in interfaceHttpServletRequest
- See Also:
-
getRequestURL
- Specified by:
getRequestURL
in interfaceHttpServletRequest
- See Also:
-
getScheme
- Specified by:
getScheme
in interfaceServletRequest
- See Also:
-
getServerName
- Specified by:
getServerName
in interfaceServletRequest
- See Also:
-
getServerPort
- Specified by:
getServerPort
in interfaceServletRequest
- See Also:
-
getServletConnection
- Specified by:
getServletConnection
in interfaceServletRequest
-
getServletContext
- Specified by:
getServletContext
in interfaceServletRequest
-
getServletPath
- Specified by:
getServletPath
in interfaceHttpServletRequest
- See Also:
-
getSession
- Specified by:
getSession
in interfaceHttpServletRequest
- See Also:
-
getSession
- Specified by:
getSession
in interfaceHttpServletRequest
- See Also:
-
getUserPrincipal
- Specified by:
getUserPrincipal
in interfaceHttpServletRequest
- See Also:
-
isAsyncStarted
- Specified by:
isAsyncStarted
in interfaceServletRequest
-
isAsyncSupported
- Specified by:
isAsyncSupported
in interfaceServletRequest
-
isRequestedSessionIdFromCookie
- Specified by:
isRequestedSessionIdFromCookie
in interfaceHttpServletRequest
- See Also:
-
isRequestedSessionIdFromURL
- Specified by:
isRequestedSessionIdFromURL
in interfaceHttpServletRequest
- See Also:
-
isRequestedSessionIdValid
- Specified by:
isRequestedSessionIdValid
in interfaceHttpServletRequest
- See Also:
-
isSecure
- Specified by:
isSecure
in interfaceServletRequest
- See Also:
-
isUserInRole
- Specified by:
isUserInRole
in interfaceHttpServletRequest
- See Also:
-
login
- Specified by:
login
in interfaceHttpServletRequest
- Throws:
ServletException
-
logout
- Specified by:
logout
in interfaceHttpServletRequest
- Throws:
ServletException
-
removeAttribute
- Specified by:
removeAttribute
in interfaceServletRequest
- See Also:
-
setAttribute
- Specified by:
setAttribute
in interfaceServletRequest
- See Also:
-
setCharacterEncoding
- Specified by:
setCharacterEncoding
in interfaceServletRequest
- Throws:
UnsupportedEncodingException
- See Also:
-
setContentLength
For testing attack scenarios in SizesTest. -
setReadLimit
Sets the read limit. This can be used to limit the number of bytes to read ahead.- Parameters:
readLimit
- the read limit to use
-
startAsync
- Specified by:
startAsync
in interfaceServletRequest
- Throws:
IllegalStateException
-
startAsync
public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws IllegalStateException - Specified by:
startAsync
in interfaceServletRequest
- Throws:
IllegalStateException
-
upgrade
public <T extends HttpUpgradeHandler> T upgrade(Class<T> handlerClass) throws IOException, ServletException - Specified by:
upgrade
in interfaceHttpServletRequest
- Throws:
IOException
ServletException
-