Package dk.netarkivet.viewerproxy
Class WebProxy.HttpRequest
- java.lang.Object
-
- dk.netarkivet.viewerproxy.WebProxy.HttpRequest
-
- All Implemented Interfaces:
Request
- Enclosing class:
- WebProxy
public static class WebProxy.HttpRequest extends java.lang.Object implements Request
A wrapper around the Jetty HttpRequest, giving the simple Request interface used in our URIResolvers. Gives access to URI and posted parameters.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
HttpRequest(javax.servlet.http.HttpServletRequest htReq)
Constructs a new HttpRequest based on the given Jetty request.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String[]>
getParameterMap()
Get parameters from this request.java.net.URI
getURI()
Get the URI from this request.static java.lang.String
uriEncode(java.lang.String s)
We here replace what should be standard API functionality with an apparent kludge.
-
-
-
Constructor Detail
-
HttpRequest
protected HttpRequest(javax.servlet.http.HttpServletRequest htReq)
Constructs a new HttpRequest based on the given Jetty request.- Parameters:
htReq
- A request object to wrap.
-
-
Method Detail
-
getURI
public java.net.URI getURI()
Get the URI from this request. In contrast to javax.servlet.HttpServletResponse this includes the query string.
-
uriEncode
public static java.lang.String uriEncode(java.lang.String s)
We here replace what should be standard API functionality with an apparent kludge. We do this because the constructor java.net.URI(String s) violates its own documentation. It should encode all "other" characters in the query part of the URI. These "other" characters include curly brackets, but actually the escaping is never done. Hence we do it here.- Parameters:
s
- the String to be encoded- Returns:
- the encoded String
-
getParameterMap
public java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
Get parameters from this request. Note that this method is invalidated when the request is replied to.- Specified by:
getParameterMap
in interfaceRequest
- Returns:
- The parameters from this request.
-
-