|
||||||||||
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
.
Nested Class Summary | |
---|---|
protected static class |
URIUtil.Coder
Deprecated. use org.apache.commons.codec.net.URLCodec |
Field Summary | |
---|---|
protected static BitSet |
empty
|
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 |
decode(String escaped,
String charset)
Unescape and decode a given string regarded as an escaped string. |
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) throws URIException
encode(String unescaped, Bitset
empty, URI.getDefaultProtocolCharset())
.
unescaped
- an unescaped string
URIException
- if the default protocol charset is not supportedURI.getDefaultProtocolCharset()
,
encode(java.lang.String, java.util.BitSet)
public static String encodeAll(String unescaped, String charset) throws URIException
encode(String unescaped, Bitset
empty, String charset)
.
unescaped
- an unescaped stringcharset
- the charset
URIException
- if the charset is not supportedencode(java.lang.String, java.util.BitSet)
public static String encodeWithinAuthority(String unescaped) throws URIException
unescaped
- an unescaped string
URIException
- if the default protocol charset is not supportedURI.getDefaultProtocolCharset()
,
encode(java.lang.String, java.util.BitSet)
public static String encodeWithinAuthority(String unescaped, String charset) throws URIException
unescaped
- an unescaped stringcharset
- the charset
URIException
- if the charset is not supportedencode(java.lang.String, java.util.BitSet)
public static String encodePathQuery(String unescaped) throws URIException
unescaped
- an unescaped string
URIException
- if the default protocol charset is not supportedURI.getDefaultProtocolCharset()
,
encode(java.lang.String, java.util.BitSet)
public static String encodePathQuery(String unescaped, String charset) throws URIException
unescaped
- an unescaped stringcharset
- the charset
URIException
- if the charset is not supportedencode(java.lang.String, java.util.BitSet)
public static String encodeWithinPath(String unescaped) throws URIException
unescaped
- an unescaped string
URIException
- if the default protocol charset is not supportedURI.getDefaultProtocolCharset()
,
encode(java.lang.String, java.util.BitSet)
public static String encodeWithinPath(String unescaped, String charset) throws URIException
unescaped
- an unescaped stringcharset
- the charset
URIException
- if the charset is not supportedencode(java.lang.String, java.util.BitSet)
public static String encodePath(String unescaped) throws URIException
unescaped
- an unescaped string
URIException
- if the default protocol charset is not supportedURI.getDefaultProtocolCharset()
,
encode(java.lang.String, java.util.BitSet)
public static String encodePath(String unescaped, String charset) throws URIException
unescaped
- an unescaped stringcharset
- the charset
URIException
- if the charset is not supportedencode(java.lang.String, java.util.BitSet)
public static String encodeWithinQuery(String unescaped) throws URIException
unescaped
- an unescaped string
URIException
- if the default protocol charset is not supportedURI.getDefaultProtocolCharset()
,
encode(java.lang.String, java.util.BitSet)
public static String encodeWithinQuery(String unescaped, String charset) throws URIException
unescaped
- an unescaped stringcharset
- the charset
URIException
- if the charset is not supportedencode(java.lang.String, java.util.BitSet)
public static String encodeQuery(String unescaped) throws URIException
unescaped
- an unescaped string
URIException
- if the default protocol charset is not supportedURI.getDefaultProtocolCharset()
,
encode(java.lang.String, java.util.BitSet)
public static String encodeQuery(String unescaped, String charset) throws URIException
unescaped
- an unescaped stringcharset
- the charset
URIException
- if the charset is not supportedencode(java.lang.String, java.util.BitSet)
public static String encode(String unescaped, BitSet allowed) throws URIException
unescaped
- a stringallowed
- allowed characters not to be escaped
URIException
- if the default protocol charset is not supportedURI.getDefaultProtocolCharset()
public static String encode(String unescaped, BitSet allowed, String charset) throws URIException
unescaped
- a stringallowed
- allowed characters not to be escapedcharset
- the charset
URIException
public static String decode(String escaped) throws URIException
escaped
- a string
URIException
- if the string cannot be decoded (invalid)URI.getDefaultProtocolCharset()
public static String decode(String escaped, String charset) throws URIException
escaped
- a stringcharset
- the charset
URIException
- if the charset is not supportedURIUtil.Coder.decode(char[], java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |