org.mortbay.util
public class UrlEncoded extends MultiMap
The UTF-8 charset is assumed, unless otherwise defined by either passing a parameter or setting the "org.mortbay.util.UrlEncoding.charset" System property.
This class is only partially synchronized. In particular, simple get operations are not protected from concurrent updates.
URLEncoder
,
Serialized FormAbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
UrlEncoded() |
UrlEncoded(String s) |
UrlEncoded(String s,
String charset) |
UrlEncoded(UrlEncoded url) |
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
void |
decode(String query) |
void |
decode(String query,
String charset) |
static void |
decode88591To(InputStream in,
MultiMap map,
int maxLength,
int maxKeys)
Decoded parameters to Map.
|
static String |
decodeString(String encoded,
int offset,
int length,
String charset)
Decode String with % encoding.
|
static void |
decodeTo(InputStream in,
MultiMap map,
String charset,
int maxLength,
int maxKeys)
Decoded parameters to Map.
|
static void |
decodeTo(String content,
MultiMap map,
String charset)
Decoded parameters to Map.
|
static void |
decodeTo(String content,
MultiMap map,
String charset,
int maxKeys)
Decoded parameters to Map.
|
static void |
decodeUtf16To(InputStream in,
MultiMap map,
int maxLength,
int maxKeys) |
static void |
decodeUtf8To(byte[] raw,
int offset,
int length,
MultiMap map)
Decoded parameters to Map.
|
static void |
decodeUtf8To(byte[] raw,
int offset,
int length,
MultiMap map,
Utf8StringBuffer buffer)
Decoded parameters to Map.
|
static void |
decodeUtf8To(InputStream in,
MultiMap map,
int maxLength,
int maxKeys)
Decoded parameters to Map.
|
String |
encode()
Encode Hashtable with % encoding.
|
static String |
encode(MultiMap map,
String charset,
boolean equalsForNullValue)
Encode Hashtable with % encoding.
|
String |
encode(String charset)
Encode Hashtable with % encoding.
|
String |
encode(String charset,
boolean equalsForNullValue)
Encode Hashtable with % encoding.
|
static String |
encodeString(String string)
Perform URL encoding.
|
static String |
encodeString(String string,
String charset)
Perform URL encoding.
|
add, addValues, addValues, get, getString, getValue, getValues, put, putAll, putValues, putValues, removeValue, toStringArrayMap
clear, containsKey, containsValue, entrySet, isEmpty, keySet, remove, size, values
equals, hashCode, toString
public static final String ENCODING
public UrlEncoded(UrlEncoded url)
public UrlEncoded()
public UrlEncoded(String s)
public void decode(String query)
public String encode()
public String encode(String charset, boolean equalsForNullValue)
equalsForNullValue
- if True, then an '=' is always used, even
for parameters without a value. e.g. "blah?a=&b=&c=".public static String encode(MultiMap map, String charset, boolean equalsForNullValue)
equalsForNullValue
- if True, then an '=' is always used, even
for parameters without a value. e.g. "blah?a=&b=&c=".public static void decodeTo(String content, MultiMap map, String charset)
content
- the string containing the encoded parameterspublic static void decodeTo(String content, MultiMap map, String charset, int maxKeys)
content
- the string containing the encoded parameterspublic static void decodeUtf8To(byte[] raw, int offset, int length, MultiMap map)
data
- the byte[] containing the encoded parameterspublic static void decodeUtf8To(byte[] raw, int offset, int length, MultiMap map, Utf8StringBuffer buffer)
data
- the byte[] containing the encoded parameterspublic static void decode88591To(InputStream in, MultiMap map, int maxLength, int maxKeys) throws IOException
in
- InputSteam to readmap
- MultiMap to add parameters tomaxLength
- maximum length of content to read or -1 for no limitmaxLength
- maximum number of keys to read or -1 for no limitIOException
public static void decodeUtf8To(InputStream in, MultiMap map, int maxLength, int maxKeys) throws IOException
in
- InputSteam to readmap
- MultiMap to add parameters tomaxLength
- maximum length of content to read or -1 for no limitmaxLength
- maximum number of keys to read or -1 for no limitIOException
public static void decodeUtf16To(InputStream in, MultiMap map, int maxLength, int maxKeys) throws IOException
IOException
public static void decodeTo(InputStream in, MultiMap map, String charset, int maxLength, int maxKeys) throws IOException
in
- the stream containing the encoded parametersIOException
public static String decodeString(String encoded, int offset, int length, String charset)
public static String encodeString(String string)
string
- public static String encodeString(String string, String charset)
string
- Copyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.