|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.microsoft.tfs.core.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 java.util.BitSet |
empty
|
Constructor Summary | |
---|---|
URIUtil()
|
Method Summary | |
---|---|
static java.lang.String |
decode(java.lang.String escaped)
Unescape and decode a given string regarded as an escaped string with the default protocol charset. |
static java.lang.String |
decode(java.lang.String escaped,
java.lang.String charset)
Unescape and decode a given string regarded as an escaped string. |
static java.lang.String |
encode(java.lang.String unescaped,
java.util.BitSet allowed)
Escape and encode a given string with allowed characters not to be escaped and the default protocol charset. |
static java.lang.String |
encode(java.lang.String unescaped,
java.util.BitSet allowed,
java.lang.String charset)
Escape and encode a given string with allowed characters not to be escaped and a given charset. |
static java.lang.String |
encodeAll(java.lang.String unescaped)
Get the all escaped and encoded string with the default protocl charset. |
static java.lang.String |
encodeAll(java.lang.String unescaped,
java.lang.String charset)
Get the all escaped and encoded string with a given charset. |
static java.lang.String |
encodePath(java.lang.String unescaped)
Escape and encode a string regarded as the path component of an URI with the default protocol charset. |
static java.lang.String |
encodePath(java.lang.String unescaped,
java.lang.String charset)
Escape and encode a string regarded as the path component of an URI with a given charset. |
static java.lang.String |
encodePathQuery(java.lang.String unescaped)
Escape and encode a string regarded as the path and query components of an URI with the default protocol charset. |
static java.lang.String |
encodePathQuery(java.lang.String unescaped,
java.lang.String charset)
Escape and encode a string regarded as the path and query components of an URI with a given charset. |
static java.lang.String |
encodeQuery(java.lang.String unescaped)
Escape and encode a string regarded as the query component of an URI with the default protocol charset. |
static java.lang.String |
encodeQuery(java.lang.String unescaped,
java.lang.String charset)
Escape and encode a string regarded as the query component of an URI with a given charset. |
static java.lang.String |
encodeWithinAuthority(java.lang.String unescaped)
Escape and encode a string regarded as within the authority component of an URI with the default protocol charset. |
static java.lang.String |
encodeWithinAuthority(java.lang.String unescaped,
java.lang.String charset)
Escape and encode a string regarded as within the authority component of an URI with a given charset. |
static java.lang.String |
encodeWithinPath(java.lang.String unescaped)
Escape and encode a string regarded as within the path component of an URI with the default protocol charset. |
static java.lang.String |
encodeWithinPath(java.lang.String unescaped,
java.lang.String charset)
Escape and encode a string regarded as within the path component of an URI with a given charset. |
static java.lang.String |
encodeWithinQuery(java.lang.String unescaped)
Escape and encode a string regarded as within the query component of an URI with the default protocol charset. |
static java.lang.String |
encodeWithinQuery(java.lang.String unescaped,
java.lang.String charset)
Escape and encode a string regarded as within the query component of an URI with a given charset. |
static java.lang.String |
getFromPath(java.lang.String uri)
Get the path of an URI and its rest part. |
static java.lang.String |
getName(java.lang.String uri)
Get the basename of an URI. |
static java.lang.String |
getPath(java.lang.String uri)
Get the path of an URI. |
static java.lang.String |
getPathQuery(java.lang.String uri)
Get the path and query of an URI. |
static java.lang.String |
getQuery(java.lang.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 java.util.BitSet empty
Constructor Detail |
---|
public URIUtil()
Method Detail |
---|
public static java.lang.String getName(java.lang.String uri)
uri
- a string regarded an URI
public static java.lang.String getQuery(java.lang.String uri)
uri
- a string regarded an URI
null
if empty or undefinedpublic static java.lang.String getPath(java.lang.String uri)
uri
- a string regarded an URI
public static java.lang.String getPathQuery(java.lang.String uri)
uri
- a string regarded an URI
public static java.lang.String getFromPath(java.lang.String uri)
uri
- a string regarded an URI
public static java.lang.String encodeAll(java.lang.String unescaped) throws URIException
encode(String unescaped, Bitset
empty, URI.getDefaultProtocolCharset())
.
unescaped
- an unescaped string
URI.getDefaultProtocolCharset()
,
encode(java.lang.String, java.util.BitSet)
URIException
- if the default protocol charset is not supportedpublic static java.lang.String encodeAll(java.lang.String unescaped, java.lang.String charset) throws URIException
encode(String unescaped, Bitset
empty, String charset)
.
unescaped
- an unescaped stringcharset
- the charset
encode(java.lang.String, java.util.BitSet)
URIException
- if the charset is not supportedpublic static java.lang.String encodeWithinAuthority(java.lang.String unescaped) throws URIException
unescaped
- an unescaped string
URI.getDefaultProtocolCharset()
,
encode(java.lang.String, java.util.BitSet)
URIException
- if the default protocol charset is not supportedpublic static java.lang.String encodeWithinAuthority(java.lang.String unescaped, java.lang.String charset) throws URIException
unescaped
- an unescaped stringcharset
- the charset
encode(java.lang.String, java.util.BitSet)
URIException
- if the charset is not supportedpublic static java.lang.String encodePathQuery(java.lang.String unescaped) throws URIException
unescaped
- an unescaped string
URI.getDefaultProtocolCharset()
,
encode(java.lang.String, java.util.BitSet)
URIException
- if the default protocol charset is not supportedpublic static java.lang.String encodePathQuery(java.lang.String unescaped, java.lang.String charset) throws URIException
unescaped
- an unescaped stringcharset
- the charset
encode(java.lang.String, java.util.BitSet)
URIException
- if the charset is not supportedpublic static java.lang.String encodeWithinPath(java.lang.String unescaped) throws URIException
unescaped
- an unescaped string
URI.getDefaultProtocolCharset()
,
encode(java.lang.String, java.util.BitSet)
URIException
- if the default protocol charset is not supportedpublic static java.lang.String encodeWithinPath(java.lang.String unescaped, java.lang.String charset) throws URIException
unescaped
- an unescaped stringcharset
- the charset
encode(java.lang.String, java.util.BitSet)
URIException
- if the charset is not supportedpublic static java.lang.String encodePath(java.lang.String unescaped) throws URIException
unescaped
- an unescaped string
URI.getDefaultProtocolCharset()
,
encode(java.lang.String, java.util.BitSet)
URIException
- if the default protocol charset is not supportedpublic static java.lang.String encodePath(java.lang.String unescaped, java.lang.String charset) throws URIException
unescaped
- an unescaped stringcharset
- the charset
encode(java.lang.String, java.util.BitSet)
URIException
- if the charset is not supportedpublic static java.lang.String encodeWithinQuery(java.lang.String unescaped) throws URIException
unescaped
- an unescaped string
URI.getDefaultProtocolCharset()
,
encode(java.lang.String, java.util.BitSet)
URIException
- if the default protocol charset is not supportedpublic static java.lang.String encodeWithinQuery(java.lang.String unescaped, java.lang.String charset) throws URIException
unescaped
- an unescaped stringcharset
- the charset
encode(java.lang.String, java.util.BitSet)
URIException
- if the charset is not supportedpublic static java.lang.String encodeQuery(java.lang.String unescaped) throws URIException
unescaped
- an unescaped string
URI.getDefaultProtocolCharset()
,
encode(java.lang.String, java.util.BitSet)
URIException
- if the default protocol charset is not supportedpublic static java.lang.String encodeQuery(java.lang.String unescaped, java.lang.String charset) throws URIException
unescaped
- an unescaped stringcharset
- the charset
encode(java.lang.String, java.util.BitSet)
URIException
- if the charset is not supportedpublic static java.lang.String encode(java.lang.String unescaped, java.util.BitSet allowed) throws URIException
unescaped
- a stringallowed
- allowed characters not to be escaped
URI.getDefaultProtocolCharset()
URIException
- if the default protocol charset is not supportedpublic static java.lang.String encode(java.lang.String unescaped, java.util.BitSet allowed, java.lang.String charset) throws URIException
unescaped
- a stringallowed
- allowed characters not to be escapedcharset
- the charset
URIException
public static java.lang.String decode(java.lang.String escaped) throws URIException
escaped
- a string
URI.getDefaultProtocolCharset()
URIException
- if the string cannot be decoded (invalid)public static java.lang.String decode(java.lang.String escaped, java.lang.String charset) throws URIException
escaped
- a stringcharset
- the charset
URIUtil.Coder.decode(char[], java.lang.String)
URIException
- if the charset is not supported
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |