: Class UrlEncoded

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 UrlEncoded

    java.lang.Object
      |
      +--java.util.Dictionary
            |
            +--java.util.Hashtable
                  |
                  +--com.mortbay.Util.UrlEncoded

public class UrlEncoded
extends java.util.Hashtable

Handles coding of MIME "x-www-form-urlencoded"

#### Notes

The hashtable either contains String single values, vectors of String or arrays of Strings.

Version:
  1.0 Fri Dec 12 1997
Author:
  Greg Wilkins (gregw)
See Also:
  `java.net.URLEncoder`, Serialized Form

Field Summary
`static java.lang.String` | `noValue`

Constructor Summary
`UrlEncoded()`
`UrlEncoded(java.lang.String s)`

Method Summary
`static void` | `addParamsTo(java.lang.String content, UrlEncoded url)`
`static java.lang.String` | `decode(java.lang.String encoded)` Decode String with % encoding
`java.lang.String` | `encode()` Encode Hashtable with % encoding
`java.lang.String` | `encode(boolean equalsForNullValue)` Encode Hashtable with % encoding
`static java.lang.String` | `encode(java.lang.String string)` Perform URL encoding.
`java.lang.Object` | `get(java.lang.Object key)` Get value Converts multiple values into coma separated list
`java.lang.Object` | `getObject(java.lang.Object key)` Get the value as an object
`java.lang.String[]` | `getValues(java.lang.String key)` Get multiple values as an array.
`void` | `putValues(java.lang.String key, java.lang.String[] values)` Set a multi valued parameter
`void` | `read(java.lang.String string_input)`

Methods inherited from class java.util.Hashtable
`clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values`

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

Field Detail

### noValue

    public static final java.lang.String noValue

Constructor Detail

### UrlEncoded

    public UrlEncoded()

### UrlEncoded

    public UrlEncoded(java.lang.String s)
               throws java.io.IOException

Method Detail

### read

    public void read(java.lang.String string_input)
              throws java.io.IOException

### get

    public java.lang.Object get(java.lang.Object key)

  Get value Converts multiple values into coma separated list
  Overrides:
    get in class java.util.Hashtable
  Parameters:
    `key` - The parameter name
  Returns:
    value

### getObject

    public java.lang.Object getObject(java.lang.Object key)

  Get the value as an object
  Parameters:
    `key` - The parameter name
  Returns:
    Either a String value or Vector of String values

### getValues

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

  Get multiple values as an array. Multiple values must be specified as "N=A&N=B"
  Parameters:
    `key` - The parameter name
  Returns:
    array of values or null

### putValues

    public void putValues(java.lang.String key,
                          java.lang.String[] values)

  Set a multi valued parameter
  Parameters:
    `key` - The parameter name
    `values` - Array of string values

### addParamsTo

    public static void addParamsTo(java.lang.String content,
                                   UrlEncoded url)

### encode

    public java.lang.String encode()

  Encode Hashtable with % encoding

### encode

    public java.lang.String encode(boolean equalsForNullValue)

  Encode Hashtable with % encoding
  Parameters:
    `equalsForNullValue` - if True, then an '=' is always used, even for parameters without a value. e.g. "blah?a=&b=&c=".

### encode

    public static java.lang.String encode(java.lang.String string)

  Perform URL encoding.
  Parameters:
    `string` -
  Returns:
    encoded string.

### decode

    public static java.lang.String decode(java.lang.String encoded)

  Decode String with % encoding

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