public final class HttpServletRequestDummy extends Object implements javax.servlet.http.HttpServletRequest, Serializable
Constructor and Description |
---|
HttpServletRequestDummy(Resource contextRoot,
String serverName,
String scriptName,
String queryString,
javax.servlet.http.Cookie[] cookies,
Pair[] headers,
Pair[] parameters,
Struct attributes,
javax.servlet.http.HttpSession session)
constructor of the class
|
Modifier and Type | Method and Description |
---|---|
void |
addHeader(String name,
String value)
add a new header value
|
void |
addParameter(String key,
String value) |
static HttpServletRequestDummy |
clone(Config config,
Resource rootDirectory,
javax.servlet.http.HttpServletRequest req) |
Object |
getAttribute(String key) |
Enumeration |
getAttributeNames() |
String |
getAuthType() |
String |
getCharacterEncoding() |
int |
getContentLength() |
String |
getContentType() |
String |
getContextPath() |
javax.servlet.http.Cookie[] |
getCookies() |
long |
getDateHeader(String name) |
String |
getHeader(String name) |
Enumeration |
getHeaderNames() |
Enumeration |
getHeaders(String name) |
byte[] |
getInputData() |
javax.servlet.ServletInputStream |
getInputStream() |
int |
getIntHeader(String name) |
Locale |
getLocale() |
Enumeration |
getLocales() |
String |
getMethod() |
String |
getParameter(String key) |
Map |
getParameterMap() |
Enumeration |
getParameterNames() |
String[] |
getParameterValues(String key) |
String |
getPathInfo() |
String |
getPathTranslated() |
String |
getProtocol() |
String |
getQueryString() |
BufferedReader |
getReader() |
String |
getRealPath(String path) |
String |
getRemoteAddr() |
String |
getRemoteHost() |
String |
getRemoteUser() |
javax.servlet.RequestDispatcher |
getRequestDispatcher(String arg0) |
String |
getRequestedSessionId() |
String |
getRequestURI() |
StringBuffer |
getRequestURL() |
String |
getScheme() |
String |
getServerName() |
int |
getServerPort() |
String |
getServletPath() |
javax.servlet.http.HttpSession |
getSession() |
javax.servlet.http.HttpSession |
getSession(boolean arg0) |
Principal |
getUserPrincipal() |
boolean |
isRequestedSessionIdFromCookie() |
boolean |
isRequestedSessionIdFromUrl() |
boolean |
isRequestedSessionIdFromURL() |
boolean |
isRequestedSessionIdValid() |
boolean |
isSecure() |
boolean |
isUserInRole(String role) |
void |
removeAttribute(String key) |
void |
setAttribute(String key,
Object value) |
void |
setAttributes(Struct attributes) |
void |
setAuthType(String authType)
sets the name of the authentication scheme used to protect the servlet.
|
void |
setCharacterEncoding(String characterEncoding) |
void |
setContentType(String contentType)
sets the content Type of the Request
|
void |
setContextPath(String contextPath)
sets the portion of the request URI that indicates the context of the request.
|
void |
setCookies(javax.servlet.http.Cookie[] cookies)
sets an array containing all of the Cookie objects
the client sent with this request.
|
void |
setDateHeader(String name,
long value) |
void |
setHeader(String name,
String value)
sets a new header value
|
void |
setInputData(byte[] inputData) |
void |
setLocale(Locale locale) |
void |
setMethod(String method)
sets the request method
|
void |
setParameter(String key,
String value) |
void |
setPathInfo(String pathInfo)
Sets any extra path information associated with the URL the client sent
when it made this request.
|
void |
setPathTranslated(String pathTranslated)
sets any extra path information after the servlet name
but before the query string, translates to a real path.
|
void |
setProtocol(String protocol)
set the Protocol (Default "http")
|
void |
setQueryString(String queryString)
sets the query string that is contained in the request URL after the path.
|
void |
setRemoteAddr(String remoteAddr) |
void |
setRemoteHost(String remoteHost) |
void |
setRemoteInetAddress(InetAddress ia) |
void |
setRemoteUser(String remoteUser)
sets the login of the user making this request,
if the user has been authenticated,
or null if the user has not been authenticated.
|
void |
setRequestedSessionId(String requestedSessionId)
sets the session ID specified by the client.
|
void |
setRequestURI(String requestURI)
sets the part of this request's URL from the protocol name
up to the query string in the first line of the HTTP request.
|
void |
setScheme(String scheme) |
void |
setSecure(boolean secure) |
void |
setServerPort(int port) |
void |
setSession(javax.servlet.http.HttpSession session) |
public HttpServletRequestDummy(Resource contextRoot, String serverName, String scriptName, String queryString, javax.servlet.http.Cookie[] cookies, Pair[] headers, Pair[] parameters, Struct attributes, javax.servlet.http.HttpSession session)
headers
- parameters
- httpSession
- pairs
- cookiess
- public String getAuthType()
getAuthType
in interface javax.servlet.http.HttpServletRequest
public void setAuthType(String authType)
authType
- authentication typepublic javax.servlet.http.Cookie[] getCookies()
getCookies
in interface javax.servlet.http.HttpServletRequest
public void setCookies(javax.servlet.http.Cookie[] cookies)
cookies
- public long getDateHeader(String name)
getDateHeader
in interface javax.servlet.http.HttpServletRequest
public void setDateHeader(String name, long value)
public String getHeader(String name)
getHeader
in interface javax.servlet.http.HttpServletRequest
public void setHeader(String name, String value)
name
- name of the new valuevalue
- header valuepublic void addHeader(String name, String value)
name
- name of the new valuevalue
- header valuepublic Enumeration getHeaders(String name)
getHeaders
in interface javax.servlet.http.HttpServletRequest
public Enumeration getHeaderNames()
getHeaderNames
in interface javax.servlet.http.HttpServletRequest
public int getIntHeader(String name)
getIntHeader
in interface javax.servlet.http.HttpServletRequest
public String getMethod()
getMethod
in interface javax.servlet.http.HttpServletRequest
public String getPathInfo()
getPathInfo
in interface javax.servlet.http.HttpServletRequest
public void setPathInfo(String pathInfo)
pathInfo
- public String getPathTranslated()
getPathTranslated
in interface javax.servlet.http.HttpServletRequest
public void setPathTranslated(String pathTranslated)
pathTranslated
- public String getContextPath()
getContextPath
in interface javax.servlet.http.HttpServletRequest
public void setContextPath(String contextPath)
contextPath
- public String getQueryString()
getQueryString
in interface javax.servlet.http.HttpServletRequest
public void setQueryString(String queryString)
queryString
- public String getRemoteUser()
getRemoteUser
in interface javax.servlet.http.HttpServletRequest
public void setRemoteUser(String remoteUser)
remoteUser
- public boolean isUserInRole(String role)
isUserInRole
in interface javax.servlet.http.HttpServletRequest
public Principal getUserPrincipal()
getUserPrincipal
in interface javax.servlet.http.HttpServletRequest
public String getRequestedSessionId()
getRequestedSessionId
in interface javax.servlet.http.HttpServletRequest
public void setRequestedSessionId(String requestedSessionId)
requestedSessionId
- public String getRequestURI()
getRequestURI
in interface javax.servlet.http.HttpServletRequest
public void setRequestURI(String requestURI)
requestURI
- public StringBuffer getRequestURL()
getRequestURL
in interface javax.servlet.http.HttpServletRequest
public String getServletPath()
getServletPath
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.HttpSession getSession(boolean arg0)
getSession
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.HttpSession getSession()
getSession
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdValid()
isRequestedSessionIdValid
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl
in interface javax.servlet.http.HttpServletRequest
public Object getAttribute(String key)
getAttribute
in interface javax.servlet.ServletRequest
public void setAttribute(String key, Object value)
setAttribute
in interface javax.servlet.ServletRequest
public void removeAttribute(String key)
removeAttribute
in interface javax.servlet.ServletRequest
public Enumeration getAttributeNames()
getAttributeNames
in interface javax.servlet.ServletRequest
public String getCharacterEncoding()
getCharacterEncoding
in interface javax.servlet.ServletRequest
public void setCharacterEncoding(String characterEncoding) throws UnsupportedEncodingException
setCharacterEncoding
in interface javax.servlet.ServletRequest
UnsupportedEncodingException
public int getContentLength()
getContentLength
in interface javax.servlet.ServletRequest
public String getContentType()
getContentType
in interface javax.servlet.ServletRequest
public void setContentType(String contentType)
contentType
- public javax.servlet.ServletInputStream getInputStream() throws IOException
getInputStream
in interface javax.servlet.ServletRequest
IOException
public void setParameter(String key, String value)
public void addParameter(String key, String value)
public String getParameter(String key)
getParameter
in interface javax.servlet.ServletRequest
public String[] getParameterValues(String key)
getParameterValues
in interface javax.servlet.ServletRequest
public Enumeration getParameterNames()
getParameterNames
in interface javax.servlet.ServletRequest
public Map getParameterMap()
getParameterMap
in interface javax.servlet.ServletRequest
public void setProtocol(String protocol)
protocol
- public String getProtocol()
getProtocol
in interface javax.servlet.ServletRequest
public String getScheme()
getScheme
in interface javax.servlet.ServletRequest
public String getServerName()
getServerName
in interface javax.servlet.ServletRequest
public int getServerPort()
getServerPort
in interface javax.servlet.ServletRequest
public void setServerPort(int port)
port
- The port to set.public BufferedReader getReader() throws IOException
getReader
in interface javax.servlet.ServletRequest
IOException
public String getRemoteAddr()
getRemoteAddr
in interface javax.servlet.ServletRequest
public void setRemoteAddr(String remoteAddr)
public void setRemoteHost(String remoteHost)
public String getRemoteHost()
getRemoteHost
in interface javax.servlet.ServletRequest
public void setRemoteInetAddress(InetAddress ia)
public Locale getLocale()
getLocale
in interface javax.servlet.ServletRequest
public Enumeration getLocales()
getLocales
in interface javax.servlet.ServletRequest
public boolean isSecure()
isSecure
in interface javax.servlet.ServletRequest
public void setSecure(boolean secure)
public javax.servlet.RequestDispatcher getRequestDispatcher(String arg0)
getRequestDispatcher
in interface javax.servlet.ServletRequest
public String getRealPath(String path)
getRealPath
in interface javax.servlet.ServletRequest
public byte[] getInputData()
public void setInputData(byte[] inputData)
inputData
- the inputData to setpublic void setSession(javax.servlet.http.HttpSession session)
public static HttpServletRequestDummy clone(Config config, Resource rootDirectory, javax.servlet.http.HttpServletRequest req)
public void setAttributes(Struct attributes)
Copyright © 2015 Lucee