Package jadex.extension.rs.publish
Class HttpServletRequestWrapper
- java.lang.Object
-
- jadex.extension.rs.publish.HttpServletRequestWrapper
-
- All Implemented Interfaces:
jakarta.servlet.http.HttpServletRequest
,jakarta.servlet.ServletRequest
public class HttpServletRequestWrapper extends java.lang.Object implements jakarta.servlet.http.HttpServletRequest
Wrapper of HttpServletRequest interface to selectivly override methods and introduce setters.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
contextpath
The contextpath.protected java.lang.String
pathinfo
The path info.protected jakarta.servlet.http.HttpServletRequest
request
The original request.protected java.lang.String
servletpath
The servlet path.
-
Constructor Summary
Constructors Constructor Description HttpServletRequestWrapper(jakarta.servlet.http.HttpServletRequest request)
Create a new wrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
authenticate(jakarta.servlet.http.HttpServletResponse response)
java.lang.String
changeSessionId()
jakarta.servlet.AsyncContext
getAsyncContext()
java.lang.Object
getAttribute(java.lang.String name)
java.util.Enumeration<java.lang.String>
getAttributeNames()
java.lang.String
getAuthType()
java.lang.String
getCharacterEncoding()
int
getContentLength()
long
getContentLengthLong()
java.lang.String
getContentType()
java.lang.String
getContextPath()
jakarta.servlet.http.Cookie[]
getCookies()
long
getDateHeader(java.lang.String name)
jakarta.servlet.DispatcherType
getDispatcherType()
java.lang.String
getHeader(java.lang.String name)
java.util.Enumeration<java.lang.String>
getHeaderNames()
java.util.Enumeration<java.lang.String>
getHeaders(java.lang.String name)
jakarta.servlet.ServletInputStream
getInputStream()
int
getIntHeader(java.lang.String name)
java.lang.String
getLocalAddr()
java.util.Locale
getLocale()
java.util.Enumeration<java.util.Locale>
getLocales()
java.lang.String
getLocalName()
int
getLocalPort()
java.lang.String
getMethod()
java.lang.String
getParameter(java.lang.String name)
java.util.Map<java.lang.String,java.lang.String[]>
getParameterMap()
java.util.Enumeration<java.lang.String>
getParameterNames()
java.lang.String[]
getParameterValues(java.lang.String name)
jakarta.servlet.http.Part
getPart(java.lang.String name)
java.util.Collection<jakarta.servlet.http.Part>
getParts()
java.lang.String
getPathInfo()
java.lang.String
getPathTranslated()
java.lang.String
getProtocol()
java.lang.String
getQueryString()
java.io.BufferedReader
getReader()
java.lang.String
getRealPath(java.lang.String path)
java.lang.String
getRemoteAddr()
java.lang.String
getRemoteHost()
int
getRemotePort()
java.lang.String
getRemoteUser()
jakarta.servlet.RequestDispatcher
getRequestDispatcher(java.lang.String path)
java.lang.String
getRequestedSessionId()
java.lang.String
getRequestURI()
java.lang.StringBuffer
getRequestURL()
java.lang.String
getScheme()
java.lang.String
getServerName()
int
getServerPort()
jakarta.servlet.ServletContext
getServletContext()
java.lang.String
getServletPath()
jakarta.servlet.http.HttpSession
getSession()
jakarta.servlet.http.HttpSession
getSession(boolean create)
java.security.Principal
getUserPrincipal()
boolean
isAsyncStarted()
boolean
isAsyncSupported()
boolean
isRequestedSessionIdFromCookie()
boolean
isRequestedSessionIdFromUrl()
boolean
isRequestedSessionIdFromURL()
boolean
isRequestedSessionIdValid()
boolean
isSecure()
boolean
isUserInRole(java.lang.String role)
void
login(java.lang.String username, java.lang.String password)
void
logout()
void
removeAttribute(java.lang.String name)
void
setAttribute(java.lang.String name, java.lang.Object o)
void
setCharacterEncoding(java.lang.String env)
void
setContextPath(java.lang.String contextpath)
Set the contextpath.void
setPathInfo(java.lang.String pathinfo)
Set the pathinfo.void
setServletPath(java.lang.String servletpath)
Set the servletpath.jakarta.servlet.AsyncContext
startAsync()
jakarta.servlet.AsyncContext
startAsync(jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse)
java.lang.String
toString()
Get the string representation.<T extends jakarta.servlet.http.HttpUpgradeHandler>
Tupgrade(java.lang.Class<T> handlerClass)
-
-
-
Method Detail
-
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
- Specified by:
getAttribute
in interfacejakarta.servlet.ServletRequest
-
getAttributeNames
public java.util.Enumeration<java.lang.String> getAttributeNames()
- Specified by:
getAttributeNames
in interfacejakarta.servlet.ServletRequest
-
getCharacterEncoding
public java.lang.String getCharacterEncoding()
- Specified by:
getCharacterEncoding
in interfacejakarta.servlet.ServletRequest
-
setCharacterEncoding
public void setCharacterEncoding(java.lang.String env) throws java.io.UnsupportedEncodingException
- Specified by:
setCharacterEncoding
in interfacejakarta.servlet.ServletRequest
- Throws:
java.io.UnsupportedEncodingException
-
getContentLength
public int getContentLength()
- Specified by:
getContentLength
in interfacejakarta.servlet.ServletRequest
-
getContentLengthLong
public long getContentLengthLong()
- Specified by:
getContentLengthLong
in interfacejakarta.servlet.ServletRequest
-
getContentType
public java.lang.String getContentType()
- Specified by:
getContentType
in interfacejakarta.servlet.ServletRequest
-
getInputStream
public jakarta.servlet.ServletInputStream getInputStream() throws java.io.IOException
- Specified by:
getInputStream
in interfacejakarta.servlet.ServletRequest
- Throws:
java.io.IOException
-
getParameter
public java.lang.String getParameter(java.lang.String name)
- Specified by:
getParameter
in interfacejakarta.servlet.ServletRequest
-
getParameterNames
public java.util.Enumeration<java.lang.String> getParameterNames()
- Specified by:
getParameterNames
in interfacejakarta.servlet.ServletRequest
-
getParameterValues
public java.lang.String[] getParameterValues(java.lang.String name)
- Specified by:
getParameterValues
in interfacejakarta.servlet.ServletRequest
-
getParameterMap
public java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
- Specified by:
getParameterMap
in interfacejakarta.servlet.ServletRequest
-
getProtocol
public java.lang.String getProtocol()
- Specified by:
getProtocol
in interfacejakarta.servlet.ServletRequest
-
getScheme
public java.lang.String getScheme()
- Specified by:
getScheme
in interfacejakarta.servlet.ServletRequest
-
getServerName
public java.lang.String getServerName()
- Specified by:
getServerName
in interfacejakarta.servlet.ServletRequest
-
getServerPort
public int getServerPort()
- Specified by:
getServerPort
in interfacejakarta.servlet.ServletRequest
-
getReader
public java.io.BufferedReader getReader() throws java.io.IOException
- Specified by:
getReader
in interfacejakarta.servlet.ServletRequest
- Throws:
java.io.IOException
-
getRemoteAddr
public java.lang.String getRemoteAddr()
- Specified by:
getRemoteAddr
in interfacejakarta.servlet.ServletRequest
-
getRemoteHost
public java.lang.String getRemoteHost()
- Specified by:
getRemoteHost
in interfacejakarta.servlet.ServletRequest
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object o)
- Specified by:
setAttribute
in interfacejakarta.servlet.ServletRequest
-
removeAttribute
public void removeAttribute(java.lang.String name)
- Specified by:
removeAttribute
in interfacejakarta.servlet.ServletRequest
-
getLocale
public java.util.Locale getLocale()
- Specified by:
getLocale
in interfacejakarta.servlet.ServletRequest
-
getLocales
public java.util.Enumeration<java.util.Locale> getLocales()
- Specified by:
getLocales
in interfacejakarta.servlet.ServletRequest
-
isSecure
public boolean isSecure()
- Specified by:
isSecure
in interfacejakarta.servlet.ServletRequest
-
getRequestDispatcher
public jakarta.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
- Specified by:
getRequestDispatcher
in interfacejakarta.servlet.ServletRequest
-
getRealPath
public java.lang.String getRealPath(java.lang.String path)
- Specified by:
getRealPath
in interfacejakarta.servlet.ServletRequest
-
getRemotePort
public int getRemotePort()
- Specified by:
getRemotePort
in interfacejakarta.servlet.ServletRequest
-
getLocalName
public java.lang.String getLocalName()
- Specified by:
getLocalName
in interfacejakarta.servlet.ServletRequest
-
getLocalAddr
public java.lang.String getLocalAddr()
- Specified by:
getLocalAddr
in interfacejakarta.servlet.ServletRequest
-
getLocalPort
public int getLocalPort()
- Specified by:
getLocalPort
in interfacejakarta.servlet.ServletRequest
-
getServletContext
public jakarta.servlet.ServletContext getServletContext()
- Specified by:
getServletContext
in interfacejakarta.servlet.ServletRequest
-
startAsync
public jakarta.servlet.AsyncContext startAsync() throws java.lang.IllegalStateException
- Specified by:
startAsync
in interfacejakarta.servlet.ServletRequest
- Throws:
java.lang.IllegalStateException
-
startAsync
public jakarta.servlet.AsyncContext startAsync(jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse) throws java.lang.IllegalStateException
- Specified by:
startAsync
in interfacejakarta.servlet.ServletRequest
- Throws:
java.lang.IllegalStateException
-
isAsyncStarted
public boolean isAsyncStarted()
- Specified by:
isAsyncStarted
in interfacejakarta.servlet.ServletRequest
-
isAsyncSupported
public boolean isAsyncSupported()
- Specified by:
isAsyncSupported
in interfacejakarta.servlet.ServletRequest
-
getAsyncContext
public jakarta.servlet.AsyncContext getAsyncContext()
- Specified by:
getAsyncContext
in interfacejakarta.servlet.ServletRequest
-
getDispatcherType
public jakarta.servlet.DispatcherType getDispatcherType()
- Specified by:
getDispatcherType
in interfacejakarta.servlet.ServletRequest
-
getAuthType
public java.lang.String getAuthType()
- Specified by:
getAuthType
in interfacejakarta.servlet.http.HttpServletRequest
-
getCookies
public jakarta.servlet.http.Cookie[] getCookies()
- Specified by:
getCookies
in interfacejakarta.servlet.http.HttpServletRequest
-
getDateHeader
public long getDateHeader(java.lang.String name)
- Specified by:
getDateHeader
in interfacejakarta.servlet.http.HttpServletRequest
-
getHeader
public java.lang.String getHeader(java.lang.String name)
- Specified by:
getHeader
in interfacejakarta.servlet.http.HttpServletRequest
-
getHeaders
public java.util.Enumeration<java.lang.String> getHeaders(java.lang.String name)
- Specified by:
getHeaders
in interfacejakarta.servlet.http.HttpServletRequest
-
getHeaderNames
public java.util.Enumeration<java.lang.String> getHeaderNames()
- Specified by:
getHeaderNames
in interfacejakarta.servlet.http.HttpServletRequest
-
getIntHeader
public int getIntHeader(java.lang.String name)
- Specified by:
getIntHeader
in interfacejakarta.servlet.http.HttpServletRequest
-
getMethod
public java.lang.String getMethod()
- Specified by:
getMethod
in interfacejakarta.servlet.http.HttpServletRequest
-
getPathInfo
public java.lang.String getPathInfo()
- Specified by:
getPathInfo
in interfacejakarta.servlet.http.HttpServletRequest
-
getPathTranslated
public java.lang.String getPathTranslated()
- Specified by:
getPathTranslated
in interfacejakarta.servlet.http.HttpServletRequest
-
getContextPath
public java.lang.String getContextPath()
- Specified by:
getContextPath
in interfacejakarta.servlet.http.HttpServletRequest
-
getQueryString
public java.lang.String getQueryString()
- Specified by:
getQueryString
in interfacejakarta.servlet.http.HttpServletRequest
-
getRemoteUser
public java.lang.String getRemoteUser()
- Specified by:
getRemoteUser
in interfacejakarta.servlet.http.HttpServletRequest
-
isUserInRole
public boolean isUserInRole(java.lang.String role)
- Specified by:
isUserInRole
in interfacejakarta.servlet.http.HttpServletRequest
-
getUserPrincipal
public java.security.Principal getUserPrincipal()
- Specified by:
getUserPrincipal
in interfacejakarta.servlet.http.HttpServletRequest
-
getRequestedSessionId
public java.lang.String getRequestedSessionId()
- Specified by:
getRequestedSessionId
in interfacejakarta.servlet.http.HttpServletRequest
-
getRequestURI
public java.lang.String getRequestURI()
- Specified by:
getRequestURI
in interfacejakarta.servlet.http.HttpServletRequest
-
getRequestURL
public java.lang.StringBuffer getRequestURL()
- Specified by:
getRequestURL
in interfacejakarta.servlet.http.HttpServletRequest
-
getServletPath
public java.lang.String getServletPath()
- Specified by:
getServletPath
in interfacejakarta.servlet.http.HttpServletRequest
-
getSession
public jakarta.servlet.http.HttpSession getSession(boolean create)
- Specified by:
getSession
in interfacejakarta.servlet.http.HttpServletRequest
-
getSession
public jakarta.servlet.http.HttpSession getSession()
- Specified by:
getSession
in interfacejakarta.servlet.http.HttpServletRequest
-
changeSessionId
public java.lang.String changeSessionId()
- Specified by:
changeSessionId
in interfacejakarta.servlet.http.HttpServletRequest
-
isRequestedSessionIdValid
public boolean isRequestedSessionIdValid()
- Specified by:
isRequestedSessionIdValid
in interfacejakarta.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromCookie
public boolean isRequestedSessionIdFromCookie()
- Specified by:
isRequestedSessionIdFromCookie
in interfacejakarta.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromURL
public boolean isRequestedSessionIdFromURL()
- Specified by:
isRequestedSessionIdFromURL
in interfacejakarta.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromUrl
public boolean isRequestedSessionIdFromUrl()
- Specified by:
isRequestedSessionIdFromUrl
in interfacejakarta.servlet.http.HttpServletRequest
-
authenticate
public boolean authenticate(jakarta.servlet.http.HttpServletResponse response) throws java.io.IOException, jakarta.servlet.ServletException
- Specified by:
authenticate
in interfacejakarta.servlet.http.HttpServletRequest
- Throws:
java.io.IOException
jakarta.servlet.ServletException
-
login
public void login(java.lang.String username, java.lang.String password) throws jakarta.servlet.ServletException
- Specified by:
login
in interfacejakarta.servlet.http.HttpServletRequest
- Throws:
jakarta.servlet.ServletException
-
logout
public void logout() throws jakarta.servlet.ServletException
- Specified by:
logout
in interfacejakarta.servlet.http.HttpServletRequest
- Throws:
jakarta.servlet.ServletException
-
getParts
public java.util.Collection<jakarta.servlet.http.Part> getParts() throws java.io.IOException, jakarta.servlet.ServletException
- Specified by:
getParts
in interfacejakarta.servlet.http.HttpServletRequest
- Throws:
java.io.IOException
jakarta.servlet.ServletException
-
getPart
public jakarta.servlet.http.Part getPart(java.lang.String name) throws java.io.IOException, jakarta.servlet.ServletException
- Specified by:
getPart
in interfacejakarta.servlet.http.HttpServletRequest
- Throws:
java.io.IOException
jakarta.servlet.ServletException
-
upgrade
public <T extends jakarta.servlet.http.HttpUpgradeHandler> T upgrade(java.lang.Class<T> handlerClass) throws java.io.IOException, jakarta.servlet.ServletException
- Specified by:
upgrade
in interfacejakarta.servlet.http.HttpServletRequest
- Throws:
java.io.IOException
jakarta.servlet.ServletException
-
setContextPath
public void setContextPath(java.lang.String contextpath)
Set the contextpath.- Parameters:
contextpath
- The contextpath to set
-
setPathInfo
public void setPathInfo(java.lang.String pathinfo)
Set the pathinfo.- Parameters:
pathinfo
- The pathinfo to set
-
setServletPath
public void setServletPath(java.lang.String servletpath)
Set the servletpath.- Parameters:
servletpath
- The servletpath to set
-
toString
public java.lang.String toString()
Get the string representation.- Overrides:
toString
in classjava.lang.Object
-
-