public class MockSlingHttpServletRequest extends Object implements org.apache.sling.api.SlingHttpServletRequest
secure
in the isSecure
method.Modifier and Type | Field and Description |
---|---|
static String |
RESOURCE_TYPE |
Constructor and Description |
---|
MockSlingHttpServletRequest(String resourcePath,
String selectors,
String extension,
String suffix,
String queryString) |
MockSlingHttpServletRequest(String resourcePath,
String selectors,
String extension,
String suffix,
String queryString,
String requestPath,
String scheme,
String server,
int port,
String contextPath) |
Modifier and Type | Method and Description |
---|---|
<AdapterType> |
adaptTo(Class<AdapterType> type) |
boolean |
authenticate(javax.servlet.http.HttpServletResponse response) |
String |
changeSessionId() |
javax.servlet.AsyncContext |
getAsyncContext() |
Object |
getAttribute(String name) |
Enumeration<String> |
getAttributeNames() |
String |
getAuthType() |
String |
getCharacterEncoding() |
int |
getContentLength() |
long |
getContentLengthLong() |
String |
getContentType() |
String |
getContextPath() |
javax.servlet.http.Cookie |
getCookie(String name) |
javax.servlet.http.Cookie[] |
getCookies() |
long |
getDateHeader(String name) |
javax.servlet.DispatcherType |
getDispatcherType() |
String |
getHeader(String name) |
Enumeration<String> |
getHeaderNames() |
Enumeration<String> |
getHeaders(String name) |
javax.servlet.ServletInputStream |
getInputStream() |
int |
getIntHeader(String name) |
String |
getLocalAddr() |
Locale |
getLocale() |
Enumeration<Locale> |
getLocales() |
String |
getLocalName() |
int |
getLocalPort() |
String |
getMethod() |
String |
getParameter(String name) |
Map<String,String[]> |
getParameterMap() |
Enumeration<String> |
getParameterNames() |
String[] |
getParameterValues(String name) |
javax.servlet.http.Part |
getPart(String name) |
Collection<javax.servlet.http.Part> |
getParts() |
String |
getPathInfo() |
String |
getPathTranslated() |
String |
getProtocol() |
String |
getQueryString() |
BufferedReader |
getReader() |
String |
getRealPath(String path)
Deprecated.
|
String |
getRemoteAddr() |
String |
getRemoteHost() |
int |
getRemotePort() |
String |
getRemoteUser() |
javax.servlet.RequestDispatcher |
getRequestDispatcher(org.apache.sling.api.resource.Resource resource) |
javax.servlet.RequestDispatcher |
getRequestDispatcher(org.apache.sling.api.resource.Resource resource,
org.apache.sling.api.request.RequestDispatcherOptions options) |
javax.servlet.RequestDispatcher |
getRequestDispatcher(String path) |
javax.servlet.RequestDispatcher |
getRequestDispatcher(String path,
org.apache.sling.api.request.RequestDispatcherOptions options) |
String |
getRequestedSessionId() |
org.apache.sling.api.request.RequestParameter |
getRequestParameter(String name) |
org.apache.sling.api.request.RequestParameterMap |
getRequestParameterMap() |
org.apache.sling.api.request.RequestParameter[] |
getRequestParameters(String name) |
org.apache.sling.api.request.RequestPathInfo |
getRequestPathInfo() |
org.apache.sling.api.request.RequestProgressTracker |
getRequestProgressTracker() |
String |
getRequestURI() |
StringBuffer |
getRequestURL() |
org.apache.sling.api.resource.Resource |
getResource() |
ResourceBundle |
getResourceBundle(Locale locale) |
ResourceBundle |
getResourceBundle(String baseName,
Locale locale) |
org.apache.sling.api.resource.ResourceResolver |
getResourceResolver() |
String |
getResponseContentType() |
Enumeration<String> |
getResponseContentTypes() |
String |
getScheme() |
String |
getServerName() |
int |
getServerPort() |
javax.servlet.ServletContext |
getServletContext() |
String |
getServletPath() |
javax.servlet.http.HttpSession |
getSession() |
javax.servlet.http.HttpSession |
getSession(boolean create) |
Principal |
getUserPrincipal() |
boolean |
isAsyncStarted() |
boolean |
isAsyncSupported() |
boolean |
isRequestedSessionIdFromCookie() |
boolean |
isRequestedSessionIdFromUrl()
Deprecated.
|
boolean |
isRequestedSessionIdFromURL() |
boolean |
isRequestedSessionIdValid() |
boolean |
isSecure() |
boolean |
isUserInRole(String role) |
void |
login(String username,
String password) |
void |
logout() |
void |
removeAttribute(String name) |
void |
setAttribute(String name,
Object o) |
void |
setCharacterEncoding(String env) |
void |
setMethod(String method) |
void |
setResource(org.apache.sling.api.resource.Resource resource) |
void |
setResourceResolver(org.apache.sling.api.resource.ResourceResolver resolver) |
void |
setSecure(boolean secure) |
javax.servlet.AsyncContext |
startAsync() |
javax.servlet.AsyncContext |
startAsync(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse) |
<T extends javax.servlet.http.HttpUpgradeHandler> |
upgrade(Class<T> handlerClass) |
public static final String RESOURCE_TYPE
public MockSlingHttpServletRequest(String resourcePath, String selectors, String extension, String suffix, String queryString)
public void setResourceResolver(org.apache.sling.api.resource.ResourceResolver resolver)
public void setResource(org.apache.sling.api.resource.Resource resource)
public void setSecure(boolean secure)
public void setMethod(String method)
public javax.servlet.http.Cookie getCookie(String name)
getCookie
in interface org.apache.sling.api.SlingHttpServletRequest
public javax.servlet.RequestDispatcher getRequestDispatcher(String path, org.apache.sling.api.request.RequestDispatcherOptions options)
getRequestDispatcher
in interface org.apache.sling.api.SlingHttpServletRequest
public javax.servlet.RequestDispatcher getRequestDispatcher(org.apache.sling.api.resource.Resource resource, org.apache.sling.api.request.RequestDispatcherOptions options)
getRequestDispatcher
in interface org.apache.sling.api.SlingHttpServletRequest
public javax.servlet.RequestDispatcher getRequestDispatcher(org.apache.sling.api.resource.Resource resource)
getRequestDispatcher
in interface org.apache.sling.api.SlingHttpServletRequest
public org.apache.sling.api.request.RequestParameter getRequestParameter(String name)
getRequestParameter
in interface org.apache.sling.api.SlingHttpServletRequest
public org.apache.sling.api.request.RequestParameterMap getRequestParameterMap()
getRequestParameterMap
in interface org.apache.sling.api.SlingHttpServletRequest
public org.apache.sling.api.request.RequestParameter[] getRequestParameters(String name)
getRequestParameters
in interface org.apache.sling.api.SlingHttpServletRequest
public org.apache.sling.api.request.RequestPathInfo getRequestPathInfo()
getRequestPathInfo
in interface org.apache.sling.api.SlingHttpServletRequest
public org.apache.sling.api.request.RequestProgressTracker getRequestProgressTracker()
getRequestProgressTracker
in interface org.apache.sling.api.SlingHttpServletRequest
public org.apache.sling.api.resource.Resource getResource()
getResource
in interface org.apache.sling.api.SlingHttpServletRequest
public ResourceBundle getResourceBundle(Locale locale)
getResourceBundle
in interface org.apache.sling.api.SlingHttpServletRequest
public ResourceBundle getResourceBundle(String baseName, Locale locale)
getResourceBundle
in interface org.apache.sling.api.SlingHttpServletRequest
public org.apache.sling.api.resource.ResourceResolver getResourceResolver()
getResourceResolver
in interface org.apache.sling.api.SlingHttpServletRequest
public String getResponseContentType()
getResponseContentType
in interface org.apache.sling.api.SlingHttpServletRequest
public Enumeration<String> getResponseContentTypes()
getResponseContentTypes
in interface org.apache.sling.api.SlingHttpServletRequest
public String getAuthType()
getAuthType
in interface javax.servlet.http.HttpServletRequest
public String getContextPath()
getContextPath
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.Cookie[] getCookies()
getCookies
in interface javax.servlet.http.HttpServletRequest
public long getDateHeader(String name)
getDateHeader
in interface javax.servlet.http.HttpServletRequest
public String getHeader(String name)
getHeader
in interface javax.servlet.http.HttpServletRequest
public Enumeration<String> getHeaderNames()
getHeaderNames
in interface javax.servlet.http.HttpServletRequest
public Enumeration<String> getHeaders(String name)
getHeaders
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 String getPathTranslated()
getPathTranslated
in interface javax.servlet.http.HttpServletRequest
public String getQueryString()
getQueryString
in interface javax.servlet.http.HttpServletRequest
public String getRemoteUser()
getRemoteUser
in interface javax.servlet.http.HttpServletRequest
public String getRequestURI()
getRequestURI
in interface javax.servlet.http.HttpServletRequest
public StringBuffer getRequestURL()
getRequestURL
in interface javax.servlet.http.HttpServletRequest
public String getRequestedSessionId()
getRequestedSessionId
in interface javax.servlet.http.HttpServletRequest
public String getServletPath()
getServletPath
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.HttpSession getSession()
getSession
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.HttpSession getSession(boolean create)
getSession
in interface javax.servlet.http.HttpServletRequest
public Principal getUserPrincipal()
getUserPrincipal
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
@Deprecated public boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdValid()
isRequestedSessionIdValid
in interface javax.servlet.http.HttpServletRequest
public boolean isUserInRole(String role)
isUserInRole
in interface javax.servlet.http.HttpServletRequest
public Object getAttribute(String name)
getAttribute
in interface javax.servlet.ServletRequest
public Enumeration<String> getAttributeNames()
getAttributeNames
in interface javax.servlet.ServletRequest
public String getCharacterEncoding()
getCharacterEncoding
in interface javax.servlet.ServletRequest
public int getContentLength()
getContentLength
in interface javax.servlet.ServletRequest
public String getContentType()
getContentType
in interface javax.servlet.ServletRequest
public javax.servlet.ServletInputStream getInputStream()
getInputStream
in interface javax.servlet.ServletRequest
public String getLocalAddr()
getLocalAddr
in interface javax.servlet.ServletRequest
public String getLocalName()
getLocalName
in interface javax.servlet.ServletRequest
public int getLocalPort()
getLocalPort
in interface javax.servlet.ServletRequest
public Locale getLocale()
getLocale
in interface javax.servlet.ServletRequest
public Enumeration<Locale> getLocales()
getLocales
in interface javax.servlet.ServletRequest
public String getParameter(String name)
getParameter
in interface javax.servlet.ServletRequest
public Map<String,String[]> getParameterMap()
getParameterMap
in interface javax.servlet.ServletRequest
public Enumeration<String> getParameterNames()
getParameterNames
in interface javax.servlet.ServletRequest
public String[] getParameterValues(String name)
getParameterValues
in interface javax.servlet.ServletRequest
public String getProtocol()
getProtocol
in interface javax.servlet.ServletRequest
public BufferedReader getReader()
getReader
in interface javax.servlet.ServletRequest
@Deprecated public String getRealPath(String path)
getRealPath
in interface javax.servlet.ServletRequest
public String getRemoteAddr()
getRemoteAddr
in interface javax.servlet.ServletRequest
public String getRemoteHost()
getRemoteHost
in interface javax.servlet.ServletRequest
public int getRemotePort()
getRemotePort
in interface javax.servlet.ServletRequest
public javax.servlet.RequestDispatcher getRequestDispatcher(String path)
getRequestDispatcher
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 boolean isSecure()
isSecure
in interface javax.servlet.ServletRequest
public void removeAttribute(String name)
removeAttribute
in interface javax.servlet.ServletRequest
public void setAttribute(String name, Object o)
setAttribute
in interface javax.servlet.ServletRequest
public void setCharacterEncoding(String env)
setCharacterEncoding
in interface javax.servlet.ServletRequest
public <AdapterType> AdapterType adaptTo(Class<AdapterType> type)
adaptTo
in interface org.apache.sling.api.adapter.Adaptable
public String changeSessionId()
changeSessionId
in interface javax.servlet.http.HttpServletRequest
public boolean authenticate(javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
authenticate
in interface javax.servlet.http.HttpServletRequest
IOException
javax.servlet.ServletException
public void login(String username, String password) throws javax.servlet.ServletException
login
in interface javax.servlet.http.HttpServletRequest
javax.servlet.ServletException
public void logout() throws javax.servlet.ServletException
logout
in interface javax.servlet.http.HttpServletRequest
javax.servlet.ServletException
public Collection<javax.servlet.http.Part> getParts() throws IOException, javax.servlet.ServletException
getParts
in interface javax.servlet.http.HttpServletRequest
IOException
javax.servlet.ServletException
public javax.servlet.http.Part getPart(String name) throws IOException, javax.servlet.ServletException
getPart
in interface javax.servlet.http.HttpServletRequest
IOException
javax.servlet.ServletException
public <T extends javax.servlet.http.HttpUpgradeHandler> T upgrade(Class<T> handlerClass) throws IOException, javax.servlet.ServletException
upgrade
in interface javax.servlet.http.HttpServletRequest
IOException
javax.servlet.ServletException
public long getContentLengthLong()
getContentLengthLong
in interface javax.servlet.ServletRequest
public javax.servlet.ServletContext getServletContext()
getServletContext
in interface javax.servlet.ServletRequest
public javax.servlet.AsyncContext startAsync() throws IllegalStateException
startAsync
in interface javax.servlet.ServletRequest
IllegalStateException
public javax.servlet.AsyncContext startAsync(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse) throws IllegalStateException
startAsync
in interface javax.servlet.ServletRequest
IllegalStateException
public boolean isAsyncStarted()
isAsyncStarted
in interface javax.servlet.ServletRequest
public boolean isAsyncSupported()
isAsyncSupported
in interface javax.servlet.ServletRequest
public javax.servlet.AsyncContext getAsyncContext()
getAsyncContext
in interface javax.servlet.ServletRequest
public javax.servlet.DispatcherType getDispatcherType()
getDispatcherType
in interface javax.servlet.ServletRequest
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.