|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.httpclient.util.URIUtil
public class URIUtil
The URI escape and character encoding and decoding utility.
It's compatible with HttpURL
rather
than URI
.
Field Summary | |
---|---|
protected static BitSet |
empty
1 bit bit set |
Constructor Summary | |
---|---|
URIUtil()
|
Method Summary | |
---|---|
static String |
decode(String escaped)
Unescape and decode a given string regarded as an escaped string with the default protocol charset. |
static String |
encode(String unescaped,
BitSet allowed)
Escape and encode a given string with allowed characters not to be escaped and the default protocol charset. |
static String |
encode(String unescaped,
BitSet allowed,
String charset)
Escape and encode a given string with allowed characters not to be escaped and a given charset. |
static String |
encodeAll(String unescaped)
Get the all escaped and encoded string with the default protocl charset. |
static String |
encodeAll(String unescaped,
String charset)
Get the all escaped and encoded string with a given charset. |
static String |
encodePath(String unescaped)
Escape and encode a string regarded as the path component of an URI with the default protocol charset. |
static String |
encodePath(String unescaped,
String charset)
Escape and encode a string regarded as the path component of an URI with a given charset. |
static String |
encodePathQuery(String unescaped)
Escape and encode a string regarded as the path and query components of an URI with the default protocol charset. |
static String |
encodePathQuery(String unescaped,
String charset)
Escape and encode a string regarded as the path and query components of an URI with a given charset. |
static String |
encodeQuery(String unescaped)
Escape and encode a string regarded as the query component of an URI with the default protocol charset. |
static String |
encodeQuery(String unescaped,
String charset)
Escape and encode a string regarded as the query component of an URI with a given charset. |
static String |
encodeWithinAuthority(String unescaped)
Escape and encode a string regarded as within the authority component of an URI with the default protocol charset. |
static String |
encodeWithinAuthority(String unescaped,
String charset)
Escape and encode a string regarded as within the authority component of an URI with a given charset. |
static String |
encodeWithinPath(String unescaped)
Escape and encode a string regarded as within the path component of an URI with the default protocol charset. |
static String |
encodeWithinPath(String unescaped,
String charset)
Escape and encode a string regarded as within the path component of an URI with a given charset. |
static String |
encodeWithinQuery(String unescaped)
Escape and encode a string regarded as within the query component of an URI with the default protocol charset. |
static String |
encodeWithinQuery(String unescaped,
String charset)
Escape and encode a string regarded as within the query component of an URI with a given charset. |
static String |
getFromPath(String uri)
Get the path of an URI and its rest part. |
static String |
getName(String uri)
Get the basename of an URI. |
static String |
getPath(String uri)
Get the path of an URI. |
static String |
getPathQuery(String uri)
Get the path and query of an URI. |
static String |
getQuery(String uri)
Get the query of an URI. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final BitSet empty
Constructor Detail |
---|
public URIUtil()
Method Detail |
---|
public static String getName(String uri)
uri
- a string regarded an URI
public static String getQuery(String uri)
uri
- a string regarded an URI
null
if empty or undefinedpublic static String getPath(String uri)
uri
- a string regarded an URI
public static String getPathQuery(String uri)
uri
- a string regarded an URI
public static String getFromPath(String uri)
uri
- a string regarded an URI
public static String encodeAll(String unescaped)
encode(String unescaped, Bitset
empty, URI.getDefaultProtocolCharset())
.
unescaped
- an unescaped string
URI.getDefaultProtocolCharset()
,
encodeAll(String, String)
public static String encodeAll(String unescaped, String charset)
encode(String unescaped, Bitset
empty, String charset)
.
unescaped
- an unescaped stringcharset
- the charset
encode(String, BitSet, String)
public static String encodeWithinAuthority(String unescaped)
unescaped
- an unescaped string
URI.getDefaultProtocolCharset()
,
encodeWithinPath(String, String)
public static String encodeWithinAuthority(String unescaped, String charset)
unescaped
- an unescaped stringcharset
- the charset
encode(String, BitSet, String)
public static String encodePathQuery(String unescaped)
unescaped
- an unescaped string
URI.getDefaultProtocolCharset()
,
encodePathQuery(String, String)
public static String encodePathQuery(String unescaped, String charset)
unescaped
- an unescaped stringcharset
- the charset
encode(String, BitSet, String)
public static String encodeWithinPath(String unescaped)
unescaped
- an unescaped string
URI.getDefaultProtocolCharset()
,
encodeWithinPath(String, String)
public static String encodeWithinPath(String unescaped, String charset)
unescaped
- an unescaped stringcharset
- the charset
encode(String, BitSet, String)
public static String encodePath(String unescaped)
unescaped
- an unescaped string
URI.getDefaultProtocolCharset()
,
encodePathQuery(String, String)
public static String encodePath(String unescaped, String charset)
unescaped
- an unescaped stringcharset
- the charset
encode(String, BitSet, String)
public static String encodeWithinQuery(String unescaped)
unescaped
- an unescaped string
URI.getDefaultProtocolCharset()
,
encodeWithinQuery(String, String)
public static String encodeWithinQuery(String unescaped, String charset)
unescaped
- an unescaped stringcharset
- the charset
encode(String, BitSet, String)
public static String encodeQuery(String unescaped)
unescaped
- an unescaped string
URI.getDefaultProtocolCharset()
,
encodeQuery(String, String)
public static String encodeQuery(String unescaped, String charset)
unescaped
- an unescaped stringcharset
- the charset
encode(String, BitSet, String)
public static String encode(String unescaped, BitSet allowed)
unescaped
- a stringallowed
- allowed characters not to be escaped
URI.getDefaultProtocolCharset()
public static String encode(String unescaped, BitSet allowed, String charset)
unescaped
- a stringallowed
- allowed characters not to be escapedcharset
- the charset
public static String decode(String escaped) throws URIException
escaped
- a string
URIException
- if the string cannot be decoded (invalid)URI.getDefaultProtocolCharset()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |