SK.gnome.dwarf.http
Class RequestURI

java.lang.Object
  extended bySK.gnome.dwarf.http.RequestURI

public class RequestURI
extends java.lang.Object

This class represents the request URI path.


Constructor Summary
protected RequestURI()
          Creates a new RequestURI.
  RequestURI(Host host, java.lang.String uri, java.lang.String enc)
          Creates a new RequestURI.
 
Method Summary
 java.lang.String getApplicationPath()
          Returns the application path.
 java.lang.String getContextPath()
          Returns the context path.
 java.lang.String getDescription()
          Returns the detailed description of the request URI.
 java.lang.String getPathInfo()
          Returns the path info.
 java.lang.String getPathTranslated()
          Returns the translated path.
 java.lang.String getQueryString()
          Returns the encoded query string.
 java.lang.String getQueryStringEncoded()
          Returns the query string.
 java.lang.String getRequestURI()
          Returns the request URI.
 java.lang.String getServletMapping()
          Returns the servlet mapping.
 java.lang.String getServletPath()
          Returns the servlet path.
 java.lang.String getURI()
          Returns the original URI.
 void recycle()
          Recycles the object.
 void setURI(Host host, java.lang.String uri, java.lang.String enc)
          Parses the URI path.
 java.lang.String toString()
          Returns string representation of the request URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RequestURI

protected RequestURI()
Creates a new RequestURI.


RequestURI

public RequestURI(Host host,
                  java.lang.String uri,
                  java.lang.String enc)
           throws java.io.IOException
Creates a new RequestURI.

First argument must be a valid Host instance. The uri argument must be an absolute path starting with the slash "/". If the URI path is url-encoded, it will be decoded according to the given encoding.

Parameters:
host - the HTTP host
uri - the URI path
enc - the Java encoding
Method Detail

setURI

public void setURI(Host host,
                   java.lang.String uri,
                   java.lang.String enc)
            throws java.io.IOException
Parses the URI path.

First argument must be a valid Host instance. The uri argument must be an absolute path starting with the slash "/". If the URI path is url-encoded, it is decoded according to the given encoding.

This method may be called more than once on the same RequestURI instance, if the recycle() method is invoked before the each subsequent call.

Parameters:
host - the HTTP host
uri - the URI path
enc - the Java encoding
Throws:
java.lang.NullPointerException - if path is null
java.lang.IllegalArgumentException - if path does not start with "/"
java.lang.IllegalStateException - if URI has been set already
java.io.IOException - if an error occured

recycle

public void recycle()
Recycles the object.

After calling this method the RequestURI object can be reused by invoking the setURI method again.


getURI

public java.lang.String getURI()
Returns the original URI.

Returns the original URI used in the constructor or the setURI method.

Returns:
the uri

getRequestURI

public java.lang.String getRequestURI()
Returns the request URI.

Returns url-encoded URI without the query string.

Returns:
the request uri

getContextPath

public java.lang.String getContextPath()
Returns the context path.

Returns the url-decoded context path.

Returns:
the context path

getServletPath

public java.lang.String getServletPath()
Returns the servlet path.

Returns the url-decoded servlet path.

Returns:
the servlet path

getPathInfo

public java.lang.String getPathInfo()
Returns the path info.

Returns the url-decoded path info.

Returns:
the path info

getPathTranslated

public java.lang.String getPathTranslated()
Returns the translated path.

Returns the url-decoded translated path info.

Returns:
the translated path

getQueryStringEncoded

public java.lang.String getQueryStringEncoded()
Returns the query string.

Returns the url-decoded query string.

Returns:
the query string

getQueryString

public java.lang.String getQueryString()
Returns the encoded query string.

Returns the url-encoded query string.

Returns:
the query string

getApplicationPath

public java.lang.String getApplicationPath()
Returns the application path.

Returns the url-decoded absolute path relative to the application context, with the query string stripped off.

Returns:
the application path

getServletMapping

public java.lang.String getServletMapping()
Returns the servlet mapping.

Returns the servlet mapping for this URI path.

Returns:
the mapping

getDescription

public java.lang.String getDescription()
Returns the detailed description of the request URI.

Returns:
the description

toString

public java.lang.String toString()
Returns string representation of the request URI.

Returns:
url-encoded URI without the query string


Copyright (c) 1999-2005, Gnome Ltd. All rights reserved.