The URI escape and character encoding and decoding utility. It's compatible with org.apache.commons.httpclient.HttpURL rather than org.apache.commons.httpclient.URI.
Type Params | Return Type | Name and description |
---|---|---|
|
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 | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Unescape and decode a given string regarded as an escaped string with the default protocol charset.
escaped
- a stringUnescape and decode a given string regarded as an escaped string.
escaped
- a stringcharset
- the charsetEscape and encode a given string with allowed characters not to be escaped and the default protocol charset.
unescaped
- a stringallowed
- allowed characters not to be escapedEscape and encode a given string with allowed characters not to be escaped and a given charset.
unescaped
- a stringallowed
- allowed characters not to be escapedcharset
- the charset Get the all escaped and encoded string with the default protocl charset.
It's the same function to use encode(String unescaped, Bitset
empty, URI.getDefaultProtocolCharset())
.
unescaped
- an unescaped string Get the all escaped and encoded string with a given charset.
It's the same function to use encode(String unescaped, Bitset
empty, String charset)
.
unescaped
- an unescaped stringcharset
- the charsetEscape and encode a string regarded as the path component of an URI with the default protocol charset.
unescaped
- an unescaped stringEscape and encode a string regarded as the path component of an URI with a given charset.
unescaped
- an unescaped stringcharset
- the charsetEscape and encode a string regarded as the path and query components of an URI with the default protocol charset.
unescaped
- an unescaped stringEscape and encode a string regarded as the path and query components of an URI with a given charset.
unescaped
- an unescaped stringcharset
- the charsetEscape and encode a string regarded as the query component of an URI with the default protocol charset. When a query string is not misunderstood the reserved special characters ("&", "=", "+", ",", and "$") within a query component, this method is recommended to use in encoding the whole query.
unescaped
- an unescaped stringEscape and encode a string regarded as the query component of an URI with a given charset. When a query string is not misunderstood the reserved special characters ("&", "=", "+", ",", and "$") within a query component, this method is recommended to use in encoding the whole query.
unescaped
- an unescaped stringcharset
- the charsetEscape and encode a string regarded as within the authority component of an URI with the default protocol charset. Within the authority component, the characters ";", ":", "@", "?", and "/" are reserved.
unescaped
- an unescaped stringEscape and encode a string regarded as within the authority component of an URI with a given charset. Within the authority component, the characters ";", ":", "@", "?", and "/" are reserved.
unescaped
- an unescaped stringcharset
- the charsetEscape and encode a string regarded as within the path component of an URI with the default protocol charset. The path may consist of a sequence of path segments separated by a single slash "/" character. Within a path segment, the characters "/", ";", "=", and "?" are reserved.
unescaped
- an unescaped stringEscape and encode a string regarded as within the path component of an URI with a given charset. The path may consist of a sequence of path segments separated by a single slash "/" character. Within a path segment, the characters "/", ";", "=", and "?" are reserved.
unescaped
- an unescaped stringcharset
- the charsetEscape and encode a string regarded as within the query component of an URI with the default protocol charset. When a query comprise the name and value pairs, it is used in order to encode each name and value string. The reserved special characters within a query component are being included in encoding the query.
unescaped
- an unescaped stringEscape and encode a string regarded as within the query component of an URI with a given charset. When a query comprise the name and value pairs, it is used in order to encode each name and value string. The reserved special characters within a query component are being included in encoding the query.
unescaped
- an unescaped stringcharset
- the charsetGet the path of an URI and its rest part.
uri
- a string regarded an URIGet the basename of an URI. It's possibly an empty string.
uri
- a string regarded an URIGet the path of an URI.
uri
- a string regarded an URIGet the path and query of an URI.
uri
- a string regarded an URIGet the query of an URI.
uri
- a string regarded an URInull
if empty or undefined