|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectccs.http.URLCoding
public class URLCoding
Static members of this class allow an arbitrary terminal URL fragment (ie. a complete URL, less the protocol section and some arbitrary path prefix) to be encoded as a terminal filepath fragment (ie. a filepath less some arbitrary path prefix), and vice-versa. The encoding handles charset conversion and arbitrary query strings.
| Constructor Summary | |
|---|---|
URLCoding()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
asciiEscape(java.lang.String str,
java.lang.String escapes)
Perform %xy escapes on an arbitrary set of US-ASCII non-control characters (only; this is intended for awkward punctuation). |
static java.lang.String |
filepathToUrl(java.lang.String filepath,
char separator,
boolean isDelimit)
Encode the terminal fragment of a filepath into the terminal fragment of a URL. |
static java.lang.String |
urlDecode(java.lang.String src)
decode URL elements. |
static java.lang.String |
urlEncode(java.lang.String src)
encode URL elements. |
static java.lang.String |
urlToFilepath(java.lang.String url,
char separator)
Decode the terminal fragment of a URL into a filepath. use this version if you don't have the two already separated for you. |
static java.lang.String |
urlToFilepath(java.lang.String urlpath,
java.lang.String query,
char separator)
Decode the terminal fragment of a URL path, and an optional query string, into a filepath. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public URLCoding()
| Method Detail |
|---|
public static java.lang.String filepathToUrl(java.lang.String filepath,
char separator,
boolean isDelimit)
filepath - The terminal fragment of the filepath (ie. the complete
path less some app-specific path prefix).separator - The filesystem separator character. '\' for Win32, '/' for
pretty much anything else.isDelimit - If true, the return is guaranteed to start with a '/'.
public static java.lang.String urlToFilepath(java.lang.String urlpath,
java.lang.String query,
char separator)
urlpath - The path element (optionally including the authority, but
not the protocol) of the URL.query - The query string, if any; null or the empty string are permitted.separator - The filesystem separator character. '\' for Win32, '/' for
pretty much anything else.
public static java.lang.String urlToFilepath(java.lang.String url,
char separator)
url - The URL fragment. Must not include the protocol, may include
the authority, must include the path, may include a query string.separator - The filesystem separator character. '\' for Win32, '/' for
pretty much anything else.
public static java.lang.String asciiEscape(java.lang.String str,
java.lang.String escapes)
str - The string to encode.escapes - The set of characters which are to be escaped.
str with escapes. If no members of escapes
appear in str, str itself is returned.public static java.lang.String urlEncode(java.lang.String src)
src - the string to encode.
public static java.lang.String urlDecode(java.lang.String src)
src - the string to decode.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||