public class WinstoneRequest extends java.lang.Object implements HttpServletRequest
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map |
attributes |
protected java.util.Stack |
attributesStack |
protected AuthenticationPrincipal |
authenticatedUser |
protected java.lang.String |
authorization |
protected int |
contentLength |
protected java.lang.String |
contentType |
protected Cookie[] |
cookies |
protected java.util.Map |
currentSessionIds |
protected java.lang.String |
deadRequestedSessionId |
protected java.lang.String |
encoding |
protected static java.text.DateFormat |
headerDF |
protected java.lang.String[] |
headers |
protected HostGroup |
hostGroup |
protected WinstoneInputStream |
inputData |
protected java.io.BufferedReader |
inputReader |
protected boolean |
isSecure |
protected java.lang.String |
localAddr |
protected java.util.List |
locales |
protected java.lang.String |
localName |
protected int |
localPort |
protected java.lang.String |
method |
protected java.util.Map |
parameters |
protected java.util.Stack |
parametersStack |
protected java.lang.Boolean |
parsedParameters
If true, it indicates that the request body was already consumed because of the call to
getParameterMap()
(or its sibling), which requires implicit form parameter parsing. |
protected java.lang.String |
pathInfo |
protected java.lang.String |
protocol |
protected java.lang.String |
queryString |
protected java.lang.String |
remoteIP |
protected java.lang.String |
remoteName |
protected int |
remotePort |
protected ServletRequestAttributeListener[] |
requestAttributeListeners |
protected java.util.Map |
requestedSessionIds |
protected ServletRequestListener[] |
requestListeners |
protected java.lang.String |
requestURI |
protected static java.util.Random |
rnd |
protected java.lang.String |
scheme |
protected java.lang.String |
serverName |
protected int |
serverPort |
protected ServletConfiguration |
servletConfig |
protected java.lang.String |
servletPath |
protected WebAppConfiguration |
webappConfig |
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH| Constructor and Description |
|---|
WinstoneRequest()
InputStream factory method.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addIncludeAttributes(java.lang.String requestURI,
java.lang.String contextPath,
java.lang.String servletPath,
java.lang.String pathInfo,
java.lang.String queryString) |
void |
addIncludeQueryParameters(java.lang.String queryString) |
void |
cleanUp()
Resets the request to be reused
|
void |
clearIncludeStackForForward() |
static java.lang.String |
decodeURLToken(java.lang.String in) |
static java.lang.String |
decodeURLToken(java.lang.String in,
boolean isQueryString) |
static java.lang.String |
decodeURLToken(java.lang.String in,
java.lang.String encoding)
For decoding the URL encoding used on query strings
|
static java.lang.String |
decodeURLToken(java.lang.String in,
java.lang.String encoding,
boolean isQueryString) |
void |
discardRequestBody() |
static void |
extractParameters(java.lang.String urlEncodedParams,
java.lang.String encoding,
java.util.Map outputParams,
boolean overwrite)
Gets parameters from the url encoded parameter string
|
java.lang.Object |
getAttribute(java.lang.String name) |
java.util.Enumeration |
getAttributeNames() |
java.util.Map |
getAttributes() |
java.util.Stack |
getAttributesStack() |
java.lang.String |
getAuthType() |
java.lang.String |
getCharacterEncoding() |
int |
getContentLength() |
java.lang.String |
getContentType() |
java.lang.String |
getContextPath() |
Cookie[] |
getCookies() |
java.util.Map |
getCurrentSessionIds() |
long |
getDateHeader(java.lang.String name) |
java.lang.String |
getDeadRequestedSessionId() |
java.lang.String |
getEncoding() |
java.lang.String |
getHeader(java.lang.String name) |
java.util.Enumeration |
getHeaderNames() |
java.util.Enumeration |
getHeaders(java.lang.String name) |
HostGroup |
getHostGroup() |
ServletInputStream |
getInputStream() |
int |
getIntHeader(java.lang.String name) |
java.util.List |
getListLocales() |
java.lang.String |
getLocalAddr() |
java.util.Locale |
getLocale() |
java.util.Enumeration |
getLocales() |
java.lang.String |
getLocalName() |
int |
getLocalPort() |
java.lang.String |
getMethod() |
java.lang.String |
getParameter(java.lang.String name) |
java.util.Map |
getParameterMap() |
java.util.Enumeration |
getParameterNames() |
java.util.Map |
getParameters() |
java.util.Stack |
getParametersStack() |
java.lang.String[] |
getParameterValues(java.lang.String name) |
java.lang.Boolean |
getParsedParameters() |
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)
Deprecated.
|
java.lang.String |
getRemoteAddr() |
java.lang.String |
getRemoteHost() |
int |
getRemotePort() |
java.lang.String |
getRemoteUser() |
RequestDispatcher |
getRequestDispatcher(java.lang.String path) |
java.lang.String |
getRequestedSessionId() |
java.util.Map |
getRequestedSessionIds() |
java.lang.String |
getRequestURI() |
java.lang.StringBuffer |
getRequestURL() |
java.lang.String |
getScheme() |
java.lang.String |
getServerName() |
int |
getServerPort() |
ServletConfiguration |
getServletConfig() |
java.lang.String |
getServletPath() |
HttpSession |
getSession() |
HttpSession |
getSession(boolean create) |
java.security.Principal |
getUserPrincipal() |
WebAppConfiguration |
getWebAppConfig() |
boolean |
isRequestedSessionIdFromCookie() |
boolean |
isRequestedSessionIdFromUrl()
Deprecated.
|
boolean |
isRequestedSessionIdFromURL() |
boolean |
isRequestedSessionIdValid() |
boolean |
isSecure() |
boolean |
isUserInRole(java.lang.String role) |
void |
markSessionsAsRequestFinished(long lastAccessedTime,
boolean saveSessions) |
void |
parseHeaders(java.util.List headerList)
Go through the list of headers, and build the headers/cookies arrays for
the request object.
|
void |
parseRequestParameters()
This takes the parameters in the body of the request and puts them into
the parameters map.
|
void |
removeAttribute(java.lang.String name) |
void |
removeIncludeAttributes() |
void |
removeIncludeQueryString() |
void |
setAttribute(java.lang.String name,
java.lang.Object o) |
void |
setAuthorization(java.lang.String auth) |
void |
setCharacterEncoding(java.lang.String encoding) |
void |
setContentLength(int len) |
void |
setContentType(java.lang.String type) |
void |
setCurrentSessionIds(java.util.Map currentSessionIds) |
void |
setDeadRequestedSessionId(java.lang.String deadRequestedSessionId) |
void |
setEncoding(java.lang.String encoding) |
void |
setForwardQueryString(java.lang.String forwardQueryString) |
void |
setHostGroup(HostGroup hostGroup) |
void |
setInputStream(WinstoneInputStream inputData) |
void |
setIsSecure(boolean isSecure) |
void |
setLocalAddr(java.lang.String ip) |
void |
setLocales(java.util.List locales) |
void |
setLocalName(java.lang.String name) |
void |
setLocalPort(int port) |
void |
setMethod(java.lang.String method) |
void |
setParsedParameters(java.lang.Boolean parsed) |
void |
setPathInfo(java.lang.String pathInfo) |
void |
setProtocol(java.lang.String protocolString) |
void |
setQueryString(java.lang.String queryString) |
void |
setRemoteIP(java.lang.String remoteIP) |
void |
setRemoteName(java.lang.String name) |
void |
setRemotePort(int port) |
void |
setRemoteUser(AuthenticationPrincipal user) |
void |
setRequestAttributeListeners(ServletRequestAttributeListener[] ral) |
void |
setRequestedSessionIds(java.util.Map requestedSessionIds) |
void |
setRequestListeners(ServletRequestListener[] rl) |
void |
setRequestURI(java.lang.String requestURI) |
void |
setScheme(java.lang.String scheme) |
void |
setServerName(java.lang.String name) |
void |
setServerPort(int port) |
void |
setServletConfig(ServletConfiguration servletConfig) |
void |
setServletPath(java.lang.String servletPath) |
void |
setWebAppConfig(WebAppConfiguration webappConfig) |
protected static java.text.DateFormat headerDF
protected static java.util.Random rnd
protected java.util.Map attributes
protected java.util.Map parameters
protected java.util.Stack attributesStack
protected java.util.Stack parametersStack
protected java.lang.String[] headers
protected Cookie[] cookies
protected java.lang.String method
protected java.lang.String scheme
protected java.lang.String serverName
protected java.lang.String requestURI
protected java.lang.String servletPath
protected java.lang.String pathInfo
protected java.lang.String queryString
protected java.lang.String protocol
protected int contentLength
protected java.lang.String contentType
protected java.lang.String encoding
protected int serverPort
protected java.lang.String remoteIP
protected java.lang.String remoteName
protected int remotePort
protected java.lang.String localAddr
protected java.lang.String localName
protected int localPort
protected java.lang.Boolean parsedParameters
getParameterMap()
(or its sibling), which requires implicit form parameter parsing.
If false, it indicates that the request body shall not be consumed by the said method, because the application
already called getInputStream() and showed the intent to parse the request body on its own.
If null, it indicates that we haven't come to that decision.protected java.util.Map requestedSessionIds
protected java.util.Map currentSessionIds
protected java.lang.String deadRequestedSessionId
protected java.util.List locales
protected java.lang.String authorization
protected boolean isSecure
protected WinstoneInputStream inputData
protected java.io.BufferedReader inputReader
protected ServletConfiguration servletConfig
protected WebAppConfiguration webappConfig
protected HostGroup hostGroup
protected AuthenticationPrincipal authenticatedUser
protected ServletRequestAttributeListener[] requestAttributeListeners
protected ServletRequestListener[] requestListeners
public void cleanUp()
public java.util.Map getAttributes()
public java.util.Map getParameters()
public java.util.Stack getAttributesStack()
public java.util.Stack getParametersStack()
public java.util.Map getCurrentSessionIds()
public java.util.Map getRequestedSessionIds()
public java.lang.String getDeadRequestedSessionId()
public HostGroup getHostGroup()
public WebAppConfiguration getWebAppConfig()
public ServletConfiguration getServletConfig()
public java.lang.String getEncoding()
public java.lang.Boolean getParsedParameters()
public java.util.List getListLocales()
public void setInputStream(WinstoneInputStream inputData)
public void setHostGroup(HostGroup hostGroup)
public void setWebAppConfig(WebAppConfiguration webappConfig)
public void setServletConfig(ServletConfiguration servletConfig)
public void setServerPort(int port)
public void setRemoteIP(java.lang.String remoteIP)
public void setRemoteName(java.lang.String name)
public void setRemotePort(int port)
public void setLocalAddr(java.lang.String ip)
public void setLocalName(java.lang.String name)
public void setLocalPort(int port)
public void setMethod(java.lang.String method)
public void setIsSecure(boolean isSecure)
public void setQueryString(java.lang.String queryString)
public void setServerName(java.lang.String name)
public void setRequestURI(java.lang.String requestURI)
public void setScheme(java.lang.String scheme)
public void setServletPath(java.lang.String servletPath)
public void setPathInfo(java.lang.String pathInfo)
public void setProtocol(java.lang.String protocolString)
public void setRemoteUser(AuthenticationPrincipal user)
public void setContentLength(int len)
public void setContentType(java.lang.String type)
public void setAuthorization(java.lang.String auth)
public void setLocales(java.util.List locales)
public void setCurrentSessionIds(java.util.Map currentSessionIds)
public void setRequestedSessionIds(java.util.Map requestedSessionIds)
public void setDeadRequestedSessionId(java.lang.String deadRequestedSessionId)
public void setEncoding(java.lang.String encoding)
public void setParsedParameters(java.lang.Boolean parsed)
public void setRequestListeners(ServletRequestListener[] rl)
public void setRequestAttributeListeners(ServletRequestAttributeListener[] ral)
public static void extractParameters(java.lang.String urlEncodedParams,
java.lang.String encoding,
java.util.Map outputParams,
boolean overwrite)
public static java.lang.String decodeURLToken(java.lang.String in)
public static java.lang.String decodeURLToken(java.lang.String in,
java.lang.String encoding)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingExceptionpublic static java.lang.String decodeURLToken(java.lang.String in,
boolean isQueryString)
public static java.lang.String decodeURLToken(java.lang.String in,
java.lang.String encoding,
boolean isQueryString)
throws java.io.UnsupportedEncodingException
isQueryString - Decode query string, where '+' is an escape for ' '. Otherwise
decode as path token, where '+' is not an escape character.java.io.UnsupportedEncodingExceptionpublic void discardRequestBody()
public void parseRequestParameters()
public void parseHeaders(java.util.List headerList)
public void addIncludeQueryParameters(java.lang.String queryString)
public void addIncludeAttributes(java.lang.String requestURI,
java.lang.String contextPath,
java.lang.String servletPath,
java.lang.String pathInfo,
java.lang.String queryString)
public void removeIncludeQueryString()
public void clearIncludeStackForForward()
public void setForwardQueryString(java.lang.String forwardQueryString)
public void removeIncludeAttributes()
public java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface ServletRequestpublic java.util.Enumeration getAttributeNames()
getAttributeNames in interface ServletRequestpublic void removeAttribute(java.lang.String name)
removeAttribute in interface ServletRequestpublic void setAttribute(java.lang.String name,
java.lang.Object o)
setAttribute in interface ServletRequestpublic java.lang.String getCharacterEncoding()
getCharacterEncoding in interface ServletRequestpublic void setCharacterEncoding(java.lang.String encoding)
throws java.io.UnsupportedEncodingException
setCharacterEncoding in interface ServletRequestjava.io.UnsupportedEncodingExceptionpublic int getContentLength()
getContentLength in interface ServletRequestpublic java.lang.String getContentType()
getContentType in interface ServletRequestpublic java.util.Locale getLocale()
getLocale in interface ServletRequestpublic java.util.Enumeration getLocales()
getLocales in interface ServletRequestpublic java.lang.String getProtocol()
getProtocol in interface ServletRequestpublic java.lang.String getScheme()
getScheme in interface ServletRequestpublic boolean isSecure()
isSecure in interface ServletRequestpublic java.io.BufferedReader getReader()
throws java.io.IOException
getReader in interface ServletRequestjava.io.IOExceptionpublic ServletInputStream getInputStream() throws java.io.IOException
getInputStream in interface ServletRequestjava.io.IOExceptionpublic java.lang.String getParameter(java.lang.String name)
getParameter in interface ServletRequestpublic java.util.Enumeration getParameterNames()
getParameterNames in interface ServletRequestpublic java.lang.String[] getParameterValues(java.lang.String name)
getParameterValues in interface ServletRequestpublic java.util.Map getParameterMap()
getParameterMap in interface ServletRequestpublic java.lang.String getServerName()
getServerName in interface ServletRequestpublic int getServerPort()
getServerPort in interface ServletRequestpublic java.lang.String getRemoteAddr()
getRemoteAddr in interface ServletRequestpublic java.lang.String getRemoteHost()
getRemoteHost in interface ServletRequestpublic int getRemotePort()
getRemotePort in interface ServletRequestpublic java.lang.String getLocalAddr()
getLocalAddr in interface ServletRequestpublic java.lang.String getLocalName()
getLocalName in interface ServletRequestpublic int getLocalPort()
getLocalPort in interface ServletRequestpublic RequestDispatcher getRequestDispatcher(java.lang.String path)
getRequestDispatcher in interface ServletRequestpublic java.lang.String getContextPath()
getContextPath in interface HttpServletRequestpublic Cookie[] getCookies()
getCookies in interface HttpServletRequestpublic long getDateHeader(java.lang.String name)
getDateHeader in interface HttpServletRequestpublic int getIntHeader(java.lang.String name)
getIntHeader in interface HttpServletRequestpublic java.lang.String getHeader(java.lang.String name)
getHeader in interface HttpServletRequestpublic java.util.Enumeration getHeaderNames()
getHeaderNames in interface HttpServletRequestpublic java.util.Enumeration getHeaders(java.lang.String name)
getHeaders in interface HttpServletRequestpublic java.lang.String getMethod()
getMethod in interface HttpServletRequestpublic java.lang.String getPathInfo()
getPathInfo in interface HttpServletRequestpublic java.lang.String getPathTranslated()
getPathTranslated in interface HttpServletRequestpublic java.lang.String getQueryString()
getQueryString in interface HttpServletRequestpublic java.lang.String getRequestURI()
getRequestURI in interface HttpServletRequestpublic java.lang.String getServletPath()
getServletPath in interface HttpServletRequestpublic java.lang.String getRequestedSessionId()
getRequestedSessionId in interface HttpServletRequestpublic java.lang.StringBuffer getRequestURL()
getRequestURL in interface HttpServletRequestpublic java.security.Principal getUserPrincipal()
getUserPrincipal in interface HttpServletRequestpublic boolean isUserInRole(java.lang.String role)
isUserInRole in interface HttpServletRequestpublic java.lang.String getAuthType()
getAuthType in interface HttpServletRequestpublic java.lang.String getRemoteUser()
getRemoteUser in interface HttpServletRequestpublic boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie in interface HttpServletRequestpublic boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL in interface HttpServletRequestpublic boolean isRequestedSessionIdValid()
isRequestedSessionIdValid in interface HttpServletRequestpublic HttpSession getSession()
getSession in interface HttpServletRequestpublic HttpSession getSession(boolean create)
getSession in interface HttpServletRequestpublic void markSessionsAsRequestFinished(long lastAccessedTime,
boolean saveSessions)
public java.lang.String getRealPath(java.lang.String path)
getRealPath in interface ServletRequestpublic boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl in interface HttpServletRequestCopyright © 2013. All Rights Reserved.