|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.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 |
dontNeedEncoding
|
protected static java.lang.String |
FILEPROTO
|
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. this method is necessary due to a missing constructor File(URL url) in java.io.File (JDK1.3.1) |
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 int MAXBYTESPERCHAR
protected static java.util.BitSet dontNeedEncoding
Method Detail |
public static java.lang.String encode(java.lang.String s)
public static java.lang.String encodeQueryString(java.lang.String s)
public static java.net.URL toURL(java.lang.String fname) throws java.net.MalformedURLException
public static java.lang.String getFileString(java.net.URL url)
public static java.lang.String getFileString(java.lang.String url)
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |