: Class URI

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.mortbay.Util
Class URI

    java.lang.Object
      |
      +--com.mortbay.Util.URI

public class URI
extends java.lang.Object

URI wrapper Wrapper for the results of javax.servlet.http.HttpServletRequest.getRequestURI()

#### Notes

Version:
  1.0 Sun Dec 14 1997
Author:
  Greg Wilkins (gregw)
See Also:
  `javax.servlet.http.HTTPServletRequest.getRequestURI`

Constructor Summary
`URI(java.lang.String uri)` Construct from a String can contain both a path and encoded query parameters.

Method Summary
`void` | `clearParameters()` Clear the URI parameters
`void` | `encodeNulls(boolean b)` Set if this URI should encode nulls as an empty = clause
`static java.lang.String` | `encodePath(java.lang.String path)`
`static void` | `encodePath(java.lang.StringBuffer buf, java.lang.String path)`
`java.lang.String` | `get(java.lang.String name)` Get named value
`java.util.Enumeration` | `getParameterNames()` Get the uri query parameters names
`java.util.Dictionary` | `getParameters()` Get the uri query parameters
`java.lang.String` | `getPath()` Get the uri path
`java.lang.String` | `getQuery()` Get the uri query String
`java.lang.String[]` | `getValues(java.lang.String name)` Get named multiple values
`java.util.Dictionary` | `parameters()` Deprecated. use getParameters
`java.lang.String` | `path()` Deprecated. Use getPath
`void` | `path(java.lang.String path)` Deprecated. Use setPath
`void` | `put(java.util.Dictionary values)` Add dictionary to the uri query parameters
`void` | `put(java.lang.String encoded)` Add encoded parameters
`void` | `put(java.lang.String name, java.lang.String value)` Add name value pair to the uri query parameters
`void` | `put(java.lang.String name, java.lang.String[] values)` Add named multi values to the uri query parameters
`java.lang.String` | `query()` Deprecated. Use getQuery
`java.util.Dictionary` | `queryContent()` Deprecated. use getParameters
`void` | `remove(java.lang.String name)` Remove named value
`void` | `setPath(java.lang.String path)` Get the uri path
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### URI

    public URI(java.lang.String uri)

  Construct from a String can contain both a path and encoded query parameters.
  Parameters:
    `uri` - The uri path and optional encoded query parameters.

Method Detail

### getPath

    public java.lang.String getPath()

  Get the uri path
  Returns:
    the URI path

### setPath

    public void setPath(java.lang.String path)

  Get the uri path
  Returns:
    the URI path

### path

    public java.lang.String path()

  Deprecated. Use getPath

  Get the uri path
  Returns:
    the URI path

### path

    public void path(java.lang.String path)

  Deprecated. Use setPath

  Get the uri path
  Returns:
    the URI path

### getQuery

    public java.lang.String getQuery()

  Get the uri query String
  Returns:
    the URI query string

### query

    public java.lang.String query()

  Deprecated. Use getQuery

  Get the uri query String
  Returns:
    the URI query string

### encodeNulls

    public void encodeNulls(boolean b)

  Set if this URI should encode nulls as an empty = clause
  Parameters:
    `b` - If true then encode nulls

### queryContent

    public java.util.Dictionary queryContent()

  Deprecated. use getParameters

  Get the uri query parameters
  Returns:
    the URI query parameters

### parameters

    public java.util.Dictionary parameters()

  Deprecated. use getParameters

  Get the uri query parameters
  Returns:
    the URI query parameters

### getParameterNames

    public java.util.Enumeration getParameterNames()

  Get the uri query parameters names
  Returns:
    the URI query parameters names

### getParameters

    public java.util.Dictionary getParameters()

  Get the uri query parameters
  Returns:
    the URI query parameters

### clearParameters

    public void clearParameters()

  Clear the URI parameters

### put

    public void put(java.lang.String encoded)

  Add encoded parameters
  Parameters:
    `encoded` - A HTTP encoded string of parameters: e.g.. "a=1&b=2"

### put

    public void put(java.lang.String name,
                    java.lang.String value)

  Add name value pair to the uri query parameters
  Parameters:
    `name` - name of value
    `value` - value

### put

    public void put(java.lang.String name,
                    java.lang.String[] values)

  Add named multi values to the uri query parameters
  Parameters:
    `name` - name of value
    `value` - value

### put

    public void put(java.util.Dictionary values)

  Add dictionary to the uri query parameters

### get

    public java.lang.String get(java.lang.String name)

  Get named value

### getValues

    public java.lang.String[] getValues(java.lang.String name)

  Get named multiple values

### remove

    public void remove(java.lang.String name)

  Remove named value

### toString

    public java.lang.String toString()

  Overrides:
    toString in class java.lang.Object
  Returns:
    the URI string encoded.

### encodePath

    public static java.lang.String encodePath(java.lang.String path)

### encodePath

    public static void encodePath(java.lang.StringBuffer buf,
                                  java.lang.String path)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD