Class JakartaMockServletHttpRequest
java.lang.Object
org.apache.commons.fileupload2.jakarta.servlet5.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
ConstructorsConstructorDescriptionJakartaMockServletHttpRequest(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 TypeMethodDescriptionbooleanauthenticate(HttpServletResponse response) getAttribute(String arg0) intlongCookie[]longgetDateHeader(String arg0) getHeaders(String arg0) intgetIntHeader(String arg0) intgetParameter(String arg0) String[]getParameterValues(String arg0) getParts()getRealPath(String path) intgetRequestDispatcher(String arg0) intgetSession(boolean arg0) booleanbooleanbooleanbooleanDeprecated.booleanbooleanbooleanisSecure()booleanisUserInRole(String arg0) voidvoidlogout()voidremoveAttribute(String arg0) voidsetAttribute(String arg0, Object arg1) voidsetCharacterEncoding(String arg0) voidsetContentLength(long length) For testing attack scenarios in SizesTest.voidsetReadLimit(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, waitMethods 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:
authenticatein interfaceHttpServletRequest- Throws:
IOExceptionServletException
-
changeSessionId
- Specified by:
changeSessionIdin interfaceHttpServletRequest
-
getAsyncContext
- Specified by:
getAsyncContextin interfaceServletRequest
-
getAttribute
- Specified by:
getAttributein interfaceServletRequest- See Also:
-
getAttributeNames
- Specified by:
getAttributeNamesin interfaceServletRequest- See Also:
-
getAuthType
- Specified by:
getAuthTypein interfaceHttpServletRequest- See Also:
-
getCharacterEncoding
- Specified by:
getCharacterEncodingin interfaceServletRequest- See Also:
-
getContentLength
- Specified by:
getContentLengthin interfaceServletRequest- See Also:
-
getContentLengthLong
- Specified by:
getContentLengthLongin interfaceServletRequest
-
getContentType
- Specified by:
getContentTypein interfaceServletRequest- See Also:
-
getContextPath
- Specified by:
getContextPathin interfaceHttpServletRequest- See Also:
-
getCookies
- Specified by:
getCookiesin interfaceHttpServletRequest- See Also:
-
getDateHeader
- Specified by:
getDateHeaderin interfaceHttpServletRequest- See Also:
-
getDispatcherType
- Specified by:
getDispatcherTypein interfaceServletRequest
-
getHeader
- Specified by:
getHeaderin interfaceHttpServletRequest- See Also:
-
getHeaderNames
- Specified by:
getHeaderNamesin interfaceHttpServletRequest- See Also:
-
getHeaders
- Specified by:
getHeadersin interfaceHttpServletRequest- See Also:
-
getInputStream
- Specified by:
getInputStreamin interfaceServletRequest- Throws:
IOException- See Also:
-
getIntHeader
- Specified by:
getIntHeaderin interfaceHttpServletRequest- See Also:
-
getLocalAddr
- Specified by:
getLocalAddrin interfaceServletRequest- See Also:
-
getLocale
- Specified by:
getLocalein interfaceServletRequest- See Also:
-
getLocales
- Specified by:
getLocalesin interfaceServletRequest- See Also:
-
getLocalName
- Specified by:
getLocalNamein interfaceServletRequest- See Also:
-
getLocalPort
- Specified by:
getLocalPortin interfaceServletRequest- See Also:
-
getMethod
- Specified by:
getMethodin interfaceHttpServletRequest- See Also:
-
getParameter
- Specified by:
getParameterin interfaceServletRequest- See Also:
-
getParameterMap
- Specified by:
getParameterMapin interfaceServletRequest- See Also:
-
getParameterNames
- Specified by:
getParameterNamesin interfaceServletRequest- See Also:
-
getParameterValues
- Specified by:
getParameterValuesin interfaceServletRequest- See Also:
-
getPart
- Specified by:
getPartin interfaceHttpServletRequest- Throws:
IOExceptionServletException
-
getParts
- Specified by:
getPartsin interfaceHttpServletRequest- Throws:
IOExceptionServletException
-
getPathInfo
- Specified by:
getPathInfoin interfaceHttpServletRequest- See Also:
-
getPathTranslated
- Specified by:
getPathTranslatedin interfaceHttpServletRequest- See Also:
-
getProtocol
- Specified by:
getProtocolin interfaceServletRequest- See Also:
-
getProtocolRequestId
-
getQueryString
- Specified by:
getQueryStringin interfaceHttpServletRequest- See Also:
-
getReader
- Specified by:
getReaderin interfaceServletRequest- Throws:
IOException- See Also:
-
getRealPath
- Specified by:
getRealPathin interfaceServletRequest
-
getRemoteAddr
- Specified by:
getRemoteAddrin interfaceServletRequest- See Also:
-
getRemoteHost
- Specified by:
getRemoteHostin interfaceServletRequest- See Also:
-
getRemotePort
- Specified by:
getRemotePortin interfaceServletRequest- See Also:
-
getRemoteUser
- Specified by:
getRemoteUserin interfaceHttpServletRequest- See Also:
-
getRequestDispatcher
- Specified by:
getRequestDispatcherin interfaceServletRequest- See Also:
-
getRequestedSessionId
- Specified by:
getRequestedSessionIdin interfaceHttpServletRequest- See Also:
-
getRequestId
-
getRequestURI
- Specified by:
getRequestURIin interfaceHttpServletRequest- See Also:
-
getRequestURL
- Specified by:
getRequestURLin interfaceHttpServletRequest- See Also:
-
getScheme
- Specified by:
getSchemein interfaceServletRequest- See Also:
-
getServerName
- Specified by:
getServerNamein interfaceServletRequest- See Also:
-
getServerPort
- Specified by:
getServerPortin interfaceServletRequest- See Also:
-
getServletContext
- Specified by:
getServletContextin interfaceServletRequest
-
getServletPath
- Specified by:
getServletPathin interfaceHttpServletRequest- See Also:
-
getSession
- Specified by:
getSessionin interfaceHttpServletRequest- See Also:
-
getSession
- Specified by:
getSessionin interfaceHttpServletRequest- See Also:
-
getUserPrincipal
- Specified by:
getUserPrincipalin interfaceHttpServletRequest- See Also:
-
isAsyncStarted
- Specified by:
isAsyncStartedin interfaceServletRequest
-
isAsyncSupported
- Specified by:
isAsyncSupportedin interfaceServletRequest
-
isRequestedSessionIdFromCookie
- Specified by:
isRequestedSessionIdFromCookiein interfaceHttpServletRequest- See Also:
-
isRequestedSessionIdFromUrl
Deprecated.- Specified by:
isRequestedSessionIdFromUrlin interfaceHttpServletRequest- See Also:
-
isRequestedSessionIdFromURL
- Specified by:
isRequestedSessionIdFromURLin interfaceHttpServletRequest- See Also:
-
isRequestedSessionIdValid
- Specified by:
isRequestedSessionIdValidin interfaceHttpServletRequest- See Also:
-
isSecure
- Specified by:
isSecurein interfaceServletRequest- See Also:
-
isUserInRole
- Specified by:
isUserInRolein interfaceHttpServletRequest- See Also:
-
login
- Specified by:
loginin interfaceHttpServletRequest- Throws:
ServletException
-
logout
- Specified by:
logoutin interfaceHttpServletRequest- Throws:
ServletException
-
removeAttribute
- Specified by:
removeAttributein interfaceServletRequest- See Also:
-
setAttribute
- Specified by:
setAttributein interfaceServletRequest- See Also:
-
setCharacterEncoding
- Specified by:
setCharacterEncodingin 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:
startAsyncin interfaceServletRequest- Throws:
IllegalStateException
-
startAsync
public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws IllegalStateException - Specified by:
startAsyncin interfaceServletRequest- Throws:
IllegalStateException
-
upgrade
public <T extends HttpUpgradeHandler> T upgrade(Class<T> handlerClass) throws IOException, ServletException - Specified by:
upgradein interfaceHttpServletRequest- Throws:
IOExceptionServletException
-