|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.acorn.net.URLEncoder
public abstract class URLEncoder
A static URL encoder. It encodes strings as specified in RFC1738 Unified Resource Locators.
Unreserved characters include 'a'-'z', 'A' - 'Z', '0' - '9', '-', '.', '_', and '~' in RFC3986. All others are decoded as character triplets consisting of the character '%' followed by the two hexadecimal digits, which form the hexadecimal value of the octet.
Encoded characters that are longer than 8-bits can be decoded back to UTF strings reliably only with the UTF-8 character encoding.
The encoder uses the platform's default character encoding if nothing else is specified.
| Field Summary | |
|---|---|
static String |
AMPERSAND
XML references (old WML browsers required an XML entity references, newer ones don't work with it!?) We apply the one required by the HTML DTD. |
| Constructor Summary | |
|---|---|
URLEncoder()
|
|
| Method Summary | |
|---|---|
static String |
encode(Map map)
Encodes a map of URL parameters using the default encoding. |
static String |
encode(Map map,
int offset,
int count)
Encodes part of a map of URL parameters using the default encoding. |
static String |
encode(Map map,
int offset,
int count,
String encoding)
Encodes part of a map of URL parameters using the specified encoding. |
static String |
encode(Map map,
String encoding)
Encodes a map of URL parameters using the specified encoding. |
static String |
encode(String param)
Encodes a URL parameter using the default encoding. |
protected static String |
encode(String str,
char[] chars,
int offset,
int count,
String encoding,
boolean ispath,
StringBuilder buffer)
Encodes a URL parameter. |
static String |
encode(String param,
String encoding)
Encodes a URL parameter using the specified encoding. |
static String |
encodePath(String path)
Encodes a URL path using the default encoding. |
static String |
encodePath(String path,
String encoding)
Encodes a URL path using the specified encoding. |
static String |
encodePathInfo(Map map)
Encodes a map of URL path parameters using the default encoding. |
static String |
encodePathInfo(Map map,
int offset,
int count)
Encodes part of a map of URL path parameters using the default encoding. |
static String |
encodePathInfo(Map map,
int offset,
int count,
String encoding)
Encodes part of a map of URL path parameters using the specified encoding. |
static String |
encodePathInfo(Map map,
String encoding)
Encodes a map of URL path parameters using the specified encoding. |
static String |
encodePathInfo(String name,
String value)
Encodes a URL path parameter using the default encoding. |
static String |
encodePathInfo(String name,
String[] value)
Encodes URL path parameters using the default encoding. |
static String |
encodePathInfo(String name,
String[] value,
String encoding)
Encodes a URL path parameters using the specified encoding. |
static String |
encodePathInfo(String name,
String value,
String encoding)
Encodes a URL path parameter using the specified encoding. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String AMPERSAND
| Constructor Detail |
|---|
public URLEncoder()
| Method Detail |
|---|
public static final String encode(String param)
param - a URL parameter.
public static final String encode(String param,
String encoding)
param - a URL parameter.encoding - the encoding.
public static final String encode(Map map)
map - a map of URL parameters.
public static final String encode(Map map,
String encoding)
map - a map of URL parameters.encoding - the encoding.
public static final String encode(Map map,
int offset,
int count)
map - a map of URL parameters.offset - the initial offset.count - the number of keys to process (-1 = all).
public static final String encode(Map map,
int offset,
int count,
String encoding)
map - a map of URL parameters.offset - the initial offset.count - the number keys to process (-1 = all).encoding - the encoding.
public static final String encodePath(String path)
path - a URL path.
public static final String encodePath(String path,
String encoding)
path - a URL path.encoding - the encoding.
public static final String encodePathInfo(String name,
String value)
name - the parameter name.value - the parameter value.
public static final String encodePathInfo(String name,
String value,
String encoding)
name - the parameter name.value - the parameter value.encoding - the encoding.
public static final String encodePathInfo(String name,
String[] value)
name - the parameter name.value - the parameter values.
public static final String encodePathInfo(String name,
String[] value,
String encoding)
name - the parameter name.value - the parameter values.encoding - the encoding.
public static final String encodePathInfo(Map map)
map - a map of path components.
public static final String encodePathInfo(Map map,
String encoding)
map - a map of path components.encoding - the encoding.
public static final String encodePathInfo(Map map,
int offset,
int count)
map - a map of path components.offset - the initial offset.count - the number keys to process (-1 = all).
public static final String encodePathInfo(Map map,
int offset,
int count,
String encoding)
map - a map of path components.offset - the initial offset.count - the number keys to process (-1 = all).encoding - the encoding.
protected static final String encode(String str,
char[] chars,
int offset,
int count,
String encoding,
boolean ispath,
StringBuilder buffer)
str - a URL parameter as a string.chars - a URL parameter as a char array.offset - the start offset in the array.count - the number of characters to decode.encoding - the encoding.ispath - true for path parameters.buffer - an optional temporary buffer.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||