protected static class JaxrsServletForJersey.RequestWrapper
extends HttpServletRequestWrapper
HTTP request handling class, which is used to transform the URI path.
Constructor and Description |
---|
JaxrsServletForJersey.RequestWrapper(HttpServletRequest request)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getHeader(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).
|
ServletInputStream |
getInputStream()
Returns the input stream of request body.
|
java.lang.String |
getMethod()
Returns the HTTP request method, such as "GET".
|
java.lang.String |
getParameter(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.String |
getQueryString()
Gets query string.
|
java.lang.String |
getRequestURI()
Returns the HTTP request part which does not contain the host name and query parameters.
|
java.lang.StringBuffer |
getRequestURL()
Returns the complete HTTP request URI, including protocol, host name, port, path, but without query parameters.
|
java.lang.String |
getServletPath()
Gets the Servlet path.
|
void |
setEntityText(java.lang.String entityText)
Sets request body content.
|
void |
setMockMethod(java.lang.String mockMethod)
Sets the mocked HTTP request method name.
|
void |
setParamMap(java.util.Map<java.lang.String,java.lang.String[]> value)
Sets parameter map.
|
public JaxrsServletForJersey.RequestWrapper(HttpServletRequest request)
The constructor.
request
- HTTP request.public void setParamMap(java.util.Map<java.lang.String,java.lang.String[]> value)
Sets parameter map.
value
-public java.lang.String getHeader(java.lang.String name)
Gets the value of the specified request header (string).
name
- The specified request header name (case not sensitive).public java.util.Enumeration<java.lang.String> getHeaders(java.lang.String name)
Gets the value of the specified request header (Enumeration object form).
name
- The specified request header name (case not sensitive).public java.util.Enumeration<java.lang.String> getHeaderNames()
Gets all the names of request headers.
public java.lang.String getMethod()
Returns the HTTP request method, such as "GET".
public java.lang.String getQueryString()
Gets query string.
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".
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".
public java.lang.String getServletPath()
Gets the Servlet path.
public ServletInputStream getInputStream() throws java.io.IOException
Returns the input stream of request body.
java.io.IOException
- Exception generated by I/O operation failure or break.public java.lang.String getParameter(java.lang.String name)
Gets the request parameter.
name
- Request parameter name.public java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
Gets parameter map.
public java.util.Enumeration<java.lang.String> getParameterNames()
Gets the names of request parameters.
public java.lang.String[] getParameterValues(java.lang.String name)
Gets the parameter value.
name
- Parameter name.public void setEntityText(java.lang.String entityText)
Sets request body content.
entityText
- The request body content.public void setMockMethod(java.lang.String mockMethod)
Sets the mocked HTTP request method name.
mockMethod
- HTTP request method name.