Class JaxrsServletForJersey.RequestWrapper
- java.lang.Object
-
- HttpServletRequestWrapper
-
- com.supermap.services.rest.JaxrsServletForJersey.RequestWrapper
-
- Enclosing class:
- JaxrsServletForJersey
protected static class JaxrsServletForJersey.RequestWrapper extends HttpServletRequestWrapperHTTP request handling class, which is used to transform the URI path.
-
-
Constructor Summary
Constructors Constructor and Description JaxrsServletForJersey.RequestWrapper(HttpServletRequest request)The constructor.
-
Method Summary
Methods Modifier and Type Method and Description java.lang.StringgetHeader(java.lang.String name)Gets the value of the specified request header (string).java.util.Enumeration<java.lang.String>getHeaderNames()Gets all the names of request headers.java.util.Enumeration<java.lang.String>getHeaders(java.lang.String name)Gets the value of the specified request header (Enumeration object form).ServletInputStreamgetInputStream()Returns the input stream of request body.java.lang.StringgetMethod()Returns the HTTP request method, such as "GET".java.lang.StringgetParameter(java.lang.String name)Gets the request parameter.java.util.Map<java.lang.String,java.lang.String[]>getParameterMap()Gets parameter map.java.util.Enumeration<java.lang.String>getParameterNames()Gets the names of request parameters.java.lang.String[]getParameterValues(java.lang.String name)Gets the parameter value.java.lang.StringgetQueryString()Gets query string.java.lang.StringgetRequestURI()Returns the HTTP request part which does not contain the host name and query parameters.java.lang.StringBuffergetRequestURL()Returns the complete HTTP request URI, including protocol, host name, port, path, but without query parameters.java.lang.StringgetServletPath()Gets the Servlet path.voidsetEntityText(java.lang.String entityText)Sets request body content.voidsetMockMethod(java.lang.String mockMethod)Sets the mocked HTTP request method name.voidsetParamMap(java.util.Map<java.lang.String,java.lang.String[]> value)Sets parameter map.
-
-
-
Constructor Detail
-
JaxrsServletForJersey.RequestWrapper
public JaxrsServletForJersey.RequestWrapper(HttpServletRequest request)
The constructor.
- Parameters:
request- HTTP request.
-
-
Method Detail
-
setParamMap
public void setParamMap(java.util.Map<java.lang.String,java.lang.String[]> value)
Sets parameter map.
- Parameters:
value-
-
getHeader
public java.lang.String getHeader(java.lang.String name)
Gets the value of the specified request header (string).
- Parameters:
name- The specified request header name (case not sensitive).- Returns:
- Request header value. If the HTTP request does not contain the specified request header, it will return null.
-
getHeaders
public java.util.Enumeration<java.lang.String> getHeaders(java.lang.String name)
Gets the value of the specified request header (Enumeration object form).
- Parameters:
name- The specified request header name (case not sensitive).- Returns:
- The Enumeration object which contains request header value. If HTTP request does not include specified request header or request header accessing is not allowed, it will return null.
-
getHeaderNames
public java.util.Enumeration<java.lang.String> getHeaderNames()
Gets all the names of request headers.
- Returns:
- The request header name expressed by Enumeration object.
-
getMethod
public java.lang.String getMethod()
Returns the HTTP request method, such as "GET".
- Returns:
- The HTTP request method.
-
getQueryString
public java.lang.String getQueryString()
Gets query string.
- Returns:
-
getRequestURI
public java.lang.String getRequestURI()
Returns the HTTP request part which does not contain the host name and query parameters.
For example for an HTTP request: "GET http://foo.bar/a.html?a=b HTTP/1.0", it will return "/a.html".
- Returns:
- Part of the HTTP request URI.
-
getRequestURL
public java.lang.StringBuffer getRequestURL()
Returns the complete HTTP request URI, including protocol, host name, port, path, but without query parameters.
For example for an HTTP request: "GET http://foo.bar/a.html?a=b HTTP/1.0", it will return "http://foo.bar/a.html".
- Returns:
- Complete HTTP request URI.
-
getServletPath
public java.lang.String getServletPath()
Gets the Servlet path.
- Returns:
- The Servlet path.
-
getInputStream
public ServletInputStream getInputStream() throws java.io.IOExceptionReturns the input stream of request body.
- Returns:
- The input stream of request body.
- Throws:
java.io.IOException- Exception generated by I/O operation failure or break.
-
getParameter
public java.lang.String getParameter(java.lang.String name)
Gets the request parameter.
- Parameters:
name- Request parameter name.- Returns:
- The request parameter.
-
getParameterMap
public java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
Gets parameter map.
- Returns:
- The parameter map.
-
getParameterNames
public java.util.Enumeration<java.lang.String> getParameterNames()
Gets the names of request parameters.
- Returns:
- The names of request parameters.
-
getParameterValues
public java.lang.String[] getParameterValues(java.lang.String name)
Gets the parameter value.
- Parameters:
name- Parameter name.- Returns:
- The list of parameter value.
-
setEntityText
public void setEntityText(java.lang.String entityText)
Sets request body content.
- Parameters:
entityText- The request body content.
-
setMockMethod
public void setMockMethod(java.lang.String mockMethod)
Sets the mocked HTTP request method name.
- Parameters:
mockMethod- HTTP request method name.
-
-