|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.acorn.net.URLDecoder
public abstract class URLDecoder
A static URL decoder. It decodes strings as specified in RFC1738 Unified Resource Locators.
Unreserved characters include 'a'-'z', 'A' - 'Z', '0' - '9', '-', '_', '.', '*', '!', '~', ''', '(' and ')' in RFC2396. 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 decoder uses the platforms's default character encoding if nothing else is specified.
| Field Summary | |
|---|---|
static String |
FILE_PROTOCOL
The file protocol. |
static String |
FILE_PROTOCOL_PREFIX
The file protocol prefix. |
static String |
HTTP_PROTOCOL
The http protocol. |
static String |
HTTP_PROTOCOL_PREFIX
The http protocol prefix. |
| Constructor Summary | |
|---|---|
URLDecoder()
|
|
| Method Summary | |
|---|---|
static String |
canonicalizePath(String path)
Canonicalizes a URI path using the default encoding. |
static String |
canonicalizePath(String path,
String encoding)
Canonicalizes a URI path using the given encoding. |
protected static String |
decode(byte[] bytes,
int offset,
int count,
boolean isPath,
String encoding)
Decodes a URL component given as a byte array. |
static Map |
decode(InputStream input)
Decodes the input stream following the application/x-www-form-urlencoded specification and using the default encoding. |
static void |
decode(InputStream input,
Map params)
Decodes the input stream following the application/x-www-form-urlencoded specification and using the default encoding. |
static Map |
decode(InputStream input,
String encoding)
Decodes the input stream following the application/x-www-form-urlencoded specification and using the given encoding. |
static void |
decode(InputStream in,
String encoding,
Map params)
Decodes the input stream following the application/x-www-form-urlencoded specification and using the given encoding. |
static String |
decode(String param)
Decodes a URL parameter using the default encoding. |
static String |
decode(String param,
String encoding)
Decodes a URL parameter using the given encoding. |
static File |
decodeFileURL(URL url)
Decodes a file from the specified URL using the default encoding. |
static File |
decodeFileURL(URL url,
String encoding)
Decodes a file from the specified URL using the given encoding. |
static String |
decodePath(String path)
Decodes a URL path using the default encoding. |
static String |
decodePath(String path,
String encoding)
Decodes a URL path using the given encoding. |
static String |
normalizePath(String path)
Returns a context-relative path that represents the canonical version of the specified path after ".." and "." elements are resolved out. |
static void |
parsePathInfo(String path,
Map params,
int start,
Map offsets)
Parses URL path parameters. |
static String |
translatePath(String path)
Translates a virtual path into a real one. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String HTTP_PROTOCOL
public static final String FILE_PROTOCOL
public static final String FILE_PROTOCOL_PREFIX
public static final String HTTP_PROTOCOL_PREFIX
| Constructor Detail |
|---|
public URLDecoder()
| Method Detail |
|---|
public static final String decode(String param)
param - a URL parameter.
public static final String decode(String param,
String encoding)
param - a URL parameter.encoding - the encoding.
public static final Map decode(InputStream input)
throws IOException
input - the input stream.
IOException - on errors.
public static final void decode(InputStream input,
Map params)
throws IOException
input - the input stream.params - a map for results.
IOException - on errors.
public static Map decode(InputStream input,
String encoding)
throws IOException
input - the input stream.encoding - the encoding for URL encoded chars.
IOException - on errors.
public static void decode(InputStream in,
String encoding,
Map params)
throws IOException
in - the input stream.encoding - the encoding for URL encoded chars.params - a map for results.
IOException - on errors.public static final File decodeFileURL(URL url)
url - the file URL.
public static final File decodeFileURL(URL url,
String encoding)
url - the file URL.encoding - the encoding for URL encoded chars.
public static final String decodePath(String path)
path - an encoded path.
public static final String decodePath(String path,
String encoding)
path - an encoded path.encoding - the encoding for URL encoded chars.
public static final String canonicalizePath(String path)
path - a path to canonicalize.
public static final String canonicalizePath(String path,
String encoding)
path - a path to canonicalize.encoding - the encoding.
public static final String normalizePath(String path)
path - a path to be normalized.
public static final String translatePath(String path)
path - a path to translate.
public static final void parsePathInfo(String path,
Map params,
int start,
Map offsets)
path - the encoded path info.params - a map for parameters.start - the start offset.offsets - a map for offsets.
protected static final String decode(byte[] bytes,
int offset,
int count,
boolean isPath,
String encoding)
bytes - a URL component as a byte array.offset - the start offset in the array.count - the number of characters to decode.isPath - true for path components.encoding - the encoding.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||