| org.mortbay.util.MultiMap org.mortbay.util.UrlEncoded
UrlEncoded | public class UrlEncoded extends MultiMap (Code) | | Handles coding of MIME "x-www-form-urlencoded".
This class handles the encoding and decoding for either
the query string of a URL or the _content of a POST HTTP request.
Notes
The hashtable either contains String single values, vectors
of String or arrays of Strings.
This class is only partially synchronised. In particular, simple
get operations are not protected from concurrent updates.
See Also: java.net.URLEncoder author: Greg Wilkins (gregw) |
Method Summary | |
public Object | clone() | public void | decode(String query) | public void | decode(String query, String charset) | public static String | decodeString(String encoded, int offset, int length, String charset) Decode String with % encoding. | public static void | decodeTo(String content, MultiMap map, String charset) Decoded parameters to Map. | public static void | decodeTo(InputStream in, MultiMap map, String charset, int maxLength) Decoded parameters to Map. | public static void | decodeUtf8To(byte[] raw, int offset, int length, MultiMap map) Decoded parameters to Map. | public static void | decodeUtf8To(InputStream in, MultiMap map, int maxLength) Decoded parameters to Map. | public String | encode() Encode Hashtable with % encoding. | public String | encode(String charset) Encode Hashtable with % encoding. | public synchronized String | encode(String charset, boolean equalsForNullValue) Encode Hashtable with % encoding.
Parameters: equalsForNullValue - if True, then an '=' is always used, evenfor parameters without a value. | public static String | encode(MultiMap map, String charset, boolean equalsForNullValue) Encode Hashtable with % encoding.
Parameters: equalsForNullValue - if True, then an '=' is always used, evenfor parameters without a value. | public static String | encodeString(String string) Perform URL encoding. | public static String | encodeString(String string, String charset) Perform URL encoding. |
UrlEncoded | public UrlEncoded()(Code) | | |
decodeString | public static String decodeString(String encoded, int offset, int length, String charset)(Code) | | Decode String with % encoding.
This method makes the assumption that the majority of calls
will need no decoding.
|
decodeTo | public static void decodeTo(String content, MultiMap map, String charset)(Code) | | Decoded parameters to Map.
Parameters: content - the string containing the encoded parameters |
decodeTo | public static void decodeTo(InputStream in, MultiMap map, String charset, int maxLength) throws IOException(Code) | | Decoded parameters to Map.
Parameters: in - the stream containing the encoded parameters |
decodeUtf8To | public static void decodeUtf8To(byte[] raw, int offset, int length, MultiMap map)(Code) | | Decoded parameters to Map.
Parameters: data - the byte[] containing the encoded parameters |
decodeUtf8To | public static void decodeUtf8To(InputStream in, MultiMap map, int maxLength) throws IOException(Code) | | Decoded parameters to Map.
Parameters: in - InputSteam to read Parameters: map - MultiMap to add parameters to Parameters: maxLength - maximum length of conent to read 0r -1 for no limit |
encode | public String encode()(Code) | | Encode Hashtable with % encoding.
|
encode | public synchronized String encode(String charset, boolean equalsForNullValue)(Code) | | Encode Hashtable with % encoding.
Parameters: equalsForNullValue - if True, then an '=' is always used, evenfor parameters without a value. e.g. "blah?a=&b=&c=". |
encode | public static String encode(MultiMap map, String charset, boolean equalsForNullValue)(Code) | | Encode Hashtable with % encoding.
Parameters: equalsForNullValue - if True, then an '=' is always used, evenfor parameters without a value. e.g. "blah?a=&b=&c=". |
encodeString | public static String encodeString(String string)(Code) | | Perform URL encoding.
Assumes 8859 charset
Parameters: string - encoded string. |
encodeString | public static String encodeString(String string, String charset)(Code) | | Perform URL encoding.
Parameters: string - encoded string. |
|
|