|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mortbay.util.URIUtil
public class URIUtil
URI Holder. This class assists with the decoding and encoding or HTTP URI's. It differs from the java.net.URL class as it does not provide communications ability, but it does assist with query string formatting.
UTF-8 encoding is used by default for % encoded characters. This may be overridden with the org.mortbay.util.URI.charset system property.
UrlEncoded
Field Summary | |
---|---|
static String |
__CHARSET
|
static String |
HTTP
|
static String |
HTTP_COLON
|
static String |
HTTPS
|
static String |
HTTPS_COLON
|
static String |
SLASH
|
Method Summary | |
---|---|
static String |
addPaths(String p1,
String p2)
Add two URI path segments. |
static String |
canonicalPath(String path)
Convert a path to a cananonical form. |
static String |
decodePath(byte[] buf,
int offset,
int length)
|
static String |
decodePath(String path)
|
static String |
encodePath(String path)
Encode a URI path. |
static StringBuffer |
encodePath(StringBuffer buf,
String path)
Encode a URI path. |
static StringBuffer |
encodeString(StringBuffer buf,
String path,
String encode)
Encode a URI path. |
static boolean |
hasScheme(String uri)
|
static String |
parentPath(String p)
Return the parent Path. |
static String |
stripPath(String path)
Strip parameters from a path. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SLASH
public static final String HTTP
public static final String HTTP_COLON
public static final String HTTPS
public static final String HTTPS_COLON
public static final String __CHARSET
Method Detail |
---|
public static String encodePath(String path)
path
- The path the encode
public static StringBuffer encodePath(StringBuffer buf, String path)
path
- The path the encodebuf
- StringBuffer to encode path into (or null)
public static StringBuffer encodeString(StringBuffer buf, String path, String encode)
path
- The path the encodebuf
- StringBuffer to encode path into (or null)encode
- String of characters to encode. % is always encoded.
public static String decodePath(String path)
public static String decodePath(byte[] buf, int offset, int length)
public static String addPaths(String p1, String p2)
p1
- URI path segmentp2
- URI path segment
public static String parentPath(String p)
public static String stripPath(String path)
public static String canonicalPath(String path)
path
-
public static boolean hasScheme(String uri)
uri
- URI
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |