|
Jacson | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.spieleck.net.URLTools
XXX This is work in progress, i.e. works as long as needed so far. Part of below code has been modified from Suns JDK Sources :-( Static methods to help certain problems with urls. Some of these are rather special String functions than actually working with the datatype URL.
| Field Summary | |
static java.lang.String |
defaultEncoding
Default assumption for urlDecode (XXX should be use UTF-8?) |
protected static java.util.BitSet |
DONT_NEED_ENC
|
protected static java.lang.String |
FILEPROTO
file URL prefix. |
protected static int |
MAXBYTESPERCHAR
|
| Method Summary | |
static java.lang.String |
decode(java.lang.String s)
Decode String from application/x-www-form-urlencoded
to regular Java encoding. |
static java.lang.String |
decode(java.lang.String s,
java.lang.String enc)
Decodes a application/x-www-form-urlencoded to regular
Java encoding with specified URL encoding. |
static java.lang.String |
encode(java.lang.String s)
|
static java.lang.String |
encodeQueryString(java.lang.String s)
Currently a quick hack to encode certain special characters in a URL's querystring part. |
static java.lang.String |
getFileString(java.lang.String url)
Alternative call with String Argument |
static java.lang.String |
getFileString(java.net.URL url)
XXX method to obtain the absolut path of a file-url. |
static java.net.URL |
toURL(java.lang.String fname)
Ugly method for the hopefully most compatible way to create a URI-String from a local file identifier. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static java.lang.String defaultEncoding
protected static final java.lang.String FILEPROTO
protected static final int MAXBYTESPERCHAR
protected static final java.util.BitSet DONT_NEED_ENC
| Method Detail |
public static java.lang.String encode(java.lang.String s)
public static java.lang.String encodeQueryString(java.lang.String s)
s - String to be encoded.
public static java.net.URL toURL(java.lang.String fname)
throws java.net.MalformedURLException
fname - File name
java.net.MalformedURLExceptionpublic static java.lang.String getFileString(java.net.URL url)
url - the URL to find a file for
public static java.lang.String getFileString(java.lang.String url)
url - the URL to find a file for in String form
public static java.lang.String decode(java.lang.String s)
application/x-www-form-urlencoded
to regular Java encoding.
public static java.lang.String decode(java.lang.String s,
java.lang.String enc)
throws java.io.UnsupportedEncodingException
application/x-www-form-urlencoded to regular
Java encoding with specified URL encoding.
s - the String to decodeenc - The name of a supported encoding.
String
java.io.UnsupportedEncodingException - If the named encoding is not supported
|
Spieleck | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||