dk.netarkivet.viewerproxy
Class WebProxy.HttpRequest

java.lang.Object
  extended by 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.


Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.

Specified by:
getURI in interface Request
Returns:
The URI from this request.
Throws:
IOFailure - if the URI is invalid. This should never happen.

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 ctor 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 interface Request
Returns:
The parameters from this request.