| java.lang.Object org.apache.commons.httpclient.URI
All known Subclasses: org.apache.commons.httpclient.HttpURL,
URI | public class URI implements Cloneable,Comparable,Serializable(Code) | | The interface for the URI(Uniform Resource Identifiers) version of RFC 2396.
This class has the purpose of supportting of parsing a URI reference to
extend any specific protocols, the character encoding of the protocol to
be transported and the charset of the document.
A URI is always in an "escaped" form, since escaping or unescaping a
completed URI might change its semantics.
Implementers should be careful not to escape or unescape the same string
more than once, since unescaping an already unescaped string might lead to
misinterpreting a percent data character as another escaped character,
or vice versa in the case of escaping an already escaped string.
In order to avoid these problems, data types used as follows:
URI character sequence: char
octet sequence: byte
original character sequence: String
So, a URI is a sequence of characters as an array of a char type, which
is not always represented as a sequence of octets as an array of byte.
URI Syntactic Components
- In general, written as follows:
Absolute URI = <scheme>:<scheme-specific-part>
Generic URI = <scheme>://<authority><path>?<query>
- Syntax
absoluteURI = scheme ":" ( hier_part | opaque_part )
hier_part = ( net_path | abs_path ) [ "?" query ]
net_path = "//" authority [ abs_path ]
abs_path = "/" path_segments
The following examples illustrate URI that are in common use.
ftp://ftp.is.co.za/rfc/rfc1808.txt
-- ftp scheme for File Transfer Protocol services
gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles
-- gopher scheme for Gopher and Gopher+ Protocol services
http://www.math.uio.no/faq/compression-faq/part1.html
-- http scheme for Hypertext Transfer Protocol services
mailto:mduerst@ifi.unizh.ch
-- mailto scheme for electronic mail addresses
news:comp.infosystems.www.servers.unix
-- news scheme for USENET news groups and articles
telnet://melvyl.ucop.edu/
-- telnet scheme for interactive services via the TELNET Protocol
Please, notice that there are many modifications from URL(RFC 1738) and
relative URL(RFC 1808).
The expressions for a URI
For escaped URI forms
- URI(char[]) // constructor
- char[] getRawXxx() // method
- String getEscapedXxx() // method
- String toString() // method
For unescaped URI forms
- URI(String) // constructor
- String getXXX() // method
author: Sung-Gu author: Mike Bowler version: $Revision: 564973 $ $Date: 2002/03/14 15:14:01 |
Inner Class :public static class LocaleToCharsetMap | |
Constructor Summary | |
protected | URI() | public | URI(String s, boolean escaped, String charset) Construct a URI from a string with the given charset. | public | URI(String s, boolean escaped) Construct a URI from a string with the given charset. | public | URI(char[] escaped, String charset) Construct a URI as an escaped form of a character array with the given
charset. | public | URI(char[] escaped) Construct a URI as an escaped form of a character array. | public | URI(String original, String charset) Construct a URI from the given string with the given charset. | public | URI(String original) Construct a URI from the given string. | public | URI(String scheme, String schemeSpecificPart, String fragment) Construct a general URI from the given components. | public | URI(String scheme, String authority, String path, String query, String fragment) Construct a general URI from the given components. | public | URI(String scheme, String userinfo, String host, int port) Construct a general URI from the given components. | public | URI(String scheme, String userinfo, String host, int port, String path) Construct a general URI from the given components. | public | URI(String scheme, String userinfo, String host, int port, String path, String query) Construct a general URI from the given components. | public | URI(String scheme, String userinfo, String host, int port, String path, String query, String fragment) Construct a general URI from the given components. | public | URI(String scheme, String host, String path, String fragment) Construct a general URI from the given components. | public | URI(URI base, String relative) Construct a general URI with the given relative URI string. | public | URI(URI base, String relative, boolean escaped) Construct a general URI with the given relative URI string.
Parameters: base - the base URI Parameters: relative - the relative URI string Parameters: escaped - true if URI character sequence is in escaped form. | public | URI(URI base, URI relative) Construct a general URI with the given relative URI.
URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
relativeURI = ( net_path | abs_path | rel_path ) [ "?" query ]
Resolving Relative References to Absolute Form.
Examples of Resolving Relative URI References
Within an object with a well-defined base URI of
http://a/b/c/d;p?q
the relative URI would be resolved as follows:
Normal Examples
g:h = g:h
g = http://a/b/c/g
./g = http://a/b/c/g
g/ = http://a/b/c/g/
/g = http://a/g
//g = http://g
?y = http://a/b/c/?y
g?y = http://a/b/c/g?y
#s = (current document)#s
g#s = http://a/b/c/g#s
g?y#s = http://a/b/c/g?y#s
;x = http://a/b/c/;x
g;x = http://a/b/c/g;x
g;x?y#s = http://a/b/c/g;x?y#s
.
|
Method Summary | |
public synchronized Object | clone() Create and return a copy of this object, the URI-reference containing
the userinfo component. | public int | compareTo(Object obj) Compare this URI to another object. | protected static String | decode(char[] component, String charset) Decodes URI encoded string.
This is a two mapping, one from URI characters to octets, and
subsequently a second from octets to original characters:
URI character sequence->octet sequence->original character sequence
A URI must be separated into its components before the escaped
characters within those components can be allowedly decoded.
Notice that there is a chance that URI characters that are non UTF-8
may be parsed as valid UTF-8. | protected static String | decode(String component, String charset) Decodes URI encoded string.
This is a two mapping, one from URI characters to octets, and
subsequently a second from octets to original characters:
URI character sequence->octet sequence->original character sequence
A URI must be separated into its components before the escaped
characters within those components can be allowedly decoded.
Notice that there is a chance that URI characters that are non UTF-8
may be parsed as valid UTF-8. | protected static char[] | encode(String original, BitSet allowed, String charset) Encodes URI string.
This is a two mapping, one from original characters to octets, and
subsequently a second from octets to URI characters:
original character sequence->octet sequence->URI character sequence
An escaped octet is encoded as a character triplet, consisting of the
percent character "%" followed by the two hexadecimal digits
representing the octet code. | protected boolean | equals(char[] first, char[] second) Test if the first array is equal to the second array. | public boolean | equals(Object obj) Test an object if this URI is equal to another. | public String | getAboveHierPath() Get the level above the this hierarchy level. | public String | getAuthority() Get the authority. | public String | getCurrentHierPath() Get the current hierarchy level. | public static String | getDefaultDocumentCharset() Get the recommended default charset of the document. | public static String | getDefaultDocumentCharsetByLocale() Get the default charset of the document by locale. | public static String | getDefaultDocumentCharsetByPlatform() Get the default charset of the document by platform. | public static String | getDefaultProtocolCharset() Get the default charset of the protocol. | public String | getEscapedAboveHierPath() Get the level above the this hierarchy level. | public String | getEscapedAuthority() Get the escaped authority. | public String | getEscapedCurrentHierPath() Get the escaped current hierarchy level. | public String | getEscapedFragment() Get the escaped fragment. | public String | getEscapedName() Get the escaped basename of the path. | public String | getEscapedPath() Get the escaped path. | public String | getEscapedPathQuery() Get the escaped query. | public String | getEscapedQuery() Get the escaped query. | public String | getEscapedURI() It can be gotten the URI character sequence. | public String | getEscapedURIReference() Get the escaped URI reference string. | public String | getEscapedUserinfo() Get the escaped userinfo. | public String | getFragment() Get the fragment. | public String | getHost() Get the host. | public String | getName() Get the basename of the path. | public String | getPath() Get the path. | public String | getPathQuery() Get the path and query. | public int | getPort() Get the port. | public String | getProtocolCharset() Get the protocol charset used by this current URI instance.
It was set by the constructor for this instance. | public String | getQuery() Get the query. | public char[] | getRawAboveHierPath() Get the level above the this hierarchy level. | public char[] | getRawAuthority() Get the raw-escaped authority. | protected char[] | getRawCurrentHierPath(char[] path) Get the raw-escaped current hierarchy level in the given path. | public char[] | getRawCurrentHierPath() Get the raw-escaped current hierarchy level. | public char[] | getRawFragment() Get the raw-escaped fragment. | public char[] | getRawHost() Get the host. | public char[] | getRawName() Get the raw-escaped basename of the path. | public char[] | getRawPath() Get the raw-escaped path. | public char[] | getRawPathQuery() Get the raw-escaped path and query. | public char[] | getRawQuery() Get the raw-escaped query. | public char[] | getRawScheme() Get the scheme. | public char[] | getRawURI() It can be gotten the URI character sequence. | public char[] | getRawURIReference() Get the URI reference character sequence. | public char[] | getRawUserinfo() Get the raw-escaped userinfo. | public String | getScheme() Get the scheme. | public String | getURI() It can be gotten the URI character sequence. | public String | getURIReference() Get the original URI reference string. | public String | getUserinfo() Get the userinfo. | public boolean | hasAuthority() Tell whether or not this URI has authority. | public boolean | hasFragment() Tell whether or not this URI has fragment. | public boolean | hasQuery() Tell whether or not this URI has query. | public boolean | hasUserinfo() Tell whether or not this URI has userinfo. | public int | hashCode() Return a hash code for this URI. | protected int | indexFirstOf(String s, String delims) Get the earlier index that to be searched for the first occurrance in
one of any of the given string. | protected int | indexFirstOf(String s, String delims, int offset) Get the earlier index that to be searched for the first occurrance in
one of any of the given string. | protected int | indexFirstOf(char[] s, char delim) Get the earlier index that to be searched for the first occurrance in
one of any of the given array. | protected int | indexFirstOf(char[] s, char delim, int offset) Get the earlier index that to be searched for the first occurrance in
one of any of the given array.
Parameters: s - the character array to be indexed Parameters: delim - the delimiter used to index Parameters: offset - The offset. | public boolean | isAbsPath() Tell whether or not the relativeURI or hier_part of this URI is abs_path. | public boolean | isAbsoluteURI() Tell whether or not this URI is absolute. | public boolean | isHierPart() Tell whether or not the absoluteURI of this URI is hier_part. | public boolean | isHostname() Tell whether or not the host part of this URI is hostname. | public boolean | isIPv4address() Tell whether or not the host part of this URI is IPv4address. | public boolean | isIPv6reference() Tell whether or not the host part of this URI is IPv6reference. | public boolean | isNetPath() Tell whether or not the relativeURI or heir_part of this URI is net_path. | public boolean | isOpaquePart() Tell whether or not the absoluteURI of this URI is opaque_part. | public boolean | isRegName() Tell whether or not the authority component of this URI is reg_name. | public boolean | isRelPath() Tell whether or not the relativeURI of this URI is rel_path. | public boolean | isRelativeURI() Tell whether or not this URI is relative. | public boolean | isServer() Tell whether or not the authority component of this URI is server. | protected char[] | normalize(char[] path) Normalize the given hier path part. | public void | normalize() Normalizes the path part of this URI. | protected void | parseAuthority(String original, boolean escaped) Parse the authority component. | protected void | parseUriReference(String original, boolean escaped) In order to avoid any possilbity of conflict with non-ASCII characters,
Parse a URI reference as a String with the character
encoding of the local system or the document. | protected boolean | prevalidate(String component, BitSet disallowed) Pre-validate the unescaped URI string within a specific component. | protected char[] | removeFragmentIdentifier(char[] component) Remove the fragment identifier of the given component. | protected char[] | resolvePath(char[] basePath, char[] relPath) Resolve the base and relative path. | public static void | setDefaultDocumentCharset(String charset) Set the default charset of the document.
Notice that it will be possible to contain mixed characters (e.g.
ftp://host/KoreanNamespace/ChineseResource). | public static void | setDefaultProtocolCharset(String charset) Set the default charset of the protocol.
The character set used to store files SHALL remain a local decision and
MAY depend on the capability of local operating systems. | public void | setEscapedAuthority(String escapedAuthority) Set the authority. | public void | setEscapedFragment(String escapedFragment) Set the escaped fragment string. | public void | setEscapedPath(String escapedPath) Set the escaped path. | public void | setEscapedQuery(String escapedQuery) Set the escaped query string. | public void | setFragment(String fragment) Set the fragment. | public void | setPath(String path) Set the path. | public void | setQuery(String query) Set the query.
When a query string is not misunderstood the reserved special characters
("&", "=", "+", ",", and "$") within a query component, it is
recommended to use in encoding the whole query with this method.
The additional APIs for the special purpose using by the reserved
special characters used in each protocol are implemented in each protocol
classes inherited from URI . | public void | setRawAuthority(char[] escapedAuthority) Set the authority. | public void | setRawFragment(char[] escapedFragment) Set the raw-escaped fragment. | public void | setRawPath(char[] escapedPath) Set the raw-escaped path. | public void | setRawQuery(char[] escapedQuery) Set the raw-escaped query. | protected void | setURI() Once it's parsed successfully, set this URI. | public String | toString() Get the escaped URI string.
On the document, the URI-reference form is only used without the userinfo
component like http://jakarta.apache.org/ by the security reason.
But the URI-reference form with the userinfo component could be parsed.
In other words, this URI and any its subclasses must not expose the
URI-reference expression with the userinfo component like
http://user:password@hostport/restricted_zone.
It means that the API client programmer should extract each user and
password to access manually. | protected boolean | validate(char[] component, BitSet generous) Validate the URI characters within a specific component.
The component must be performed after escape encoding. | protected boolean | validate(char[] component, int soffset, int eoffset, BitSet generous) Validate the URI characters within a specific component.
The component must be performed after escape encoding. |
IPv4address | final protected static BitSet IPv4address(Code) | | Bitset that combines digit and dot fo IPv$address.
IPv4address = 1*digit "." 1*digit "." 1*digit "." 1*digit
|
IPv6address | final protected static BitSet IPv6address(Code) | | RFC 2373.
IPv6address = hexpart [ ":" IPv4address ]
|
IPv6reference | final protected static BitSet IPv6reference(Code) | | RFC 2732, 2373.
IPv6reference = "[" IPv6address "]"
|
URI_reference | final protected static BitSet URI_reference(Code) | | BitSet for URI-reference.
URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
|
_authority | protected char[] _authority(Code) | | The authority.
|
_fragment | protected char[] _fragment(Code) | | The fragment.
|
_host | protected char[] _host(Code) | | The host.
|
_is_IPv4address | protected boolean _is_IPv4address(Code) | | |
_is_IPv6reference | protected boolean _is_IPv6reference(Code) | | |
_is_abs_path | protected boolean _is_abs_path(Code) | | |
_is_hier_part | protected boolean _is_hier_part(Code) | | |
_is_hostname | protected boolean _is_hostname(Code) | | |
_is_net_path | protected boolean _is_net_path(Code) | | |
_is_opaque_part | protected boolean _is_opaque_part(Code) | | |
_is_reg_name | protected boolean _is_reg_name(Code) | | |
_is_rel_path | protected boolean _is_rel_path(Code) | | |
_is_server | protected boolean _is_server(Code) | | |
_opaque | protected char[] _opaque(Code) | | The opaque.
|
_path | protected char[] _path(Code) | | The path.
|
_port | protected int _port(Code) | | The port.
|
_query | protected char[] _query(Code) | | The query.
|
_scheme | protected char[] _scheme(Code) | | The scheme.
|
_uri | protected char[] _uri(Code) | | This Uniform Resource Identifier (URI).
The URI is always in an "escaped" form, since escaping or unescaping
a completed URI might change its semantics.
|
_userinfo | protected char[] _userinfo(Code) | | The userinfo.
|
abs_path | final protected static BitSet abs_path(Code) | | URI absolute path.
abs_path = "/" path_segments
|
absoluteURI | final protected static BitSet absoluteURI(Code) | | BitSet for absoluteURI.
absoluteURI = scheme ":" ( hier_part | opaque_part )
|
allowed_IPv6reference | final public static BitSet allowed_IPv6reference(Code) | | Those characters that are allowed for the IPv6reference component.
The characters '[', ']' in IPv6reference should be excluded.
|
allowed_abs_path | final public static BitSet allowed_abs_path(Code) | | Those characters that are allowed for the abs_path.
|
allowed_authority | final public static BitSet allowed_authority(Code) | | Those characters that are allowed for the authority component.
|
allowed_fragment | final public static BitSet allowed_fragment(Code) | | Those characters that are allowed for the fragment component.
|
allowed_host | final public static BitSet allowed_host(Code) | | Those characters that are allowed for the host component.
The characters '[', ']' in IPv6reference should be excluded.
|
allowed_opaque_part | final public static BitSet allowed_opaque_part(Code) | | Those characters that are allowed for the opaque_part.
|
allowed_query | final public static BitSet allowed_query(Code) | | Those characters that are allowed for the query component.
|
allowed_reg_name | final public static BitSet allowed_reg_name(Code) | | Those characters that are allowed for the reg_name.
|
allowed_rel_path | final public static BitSet allowed_rel_path(Code) | | Those characters that are allowed for the rel_path.
|
allowed_userinfo | final public static BitSet allowed_userinfo(Code) | | Those characters that are allowed for the userinfo component.
|
allowed_within_authority | final public static BitSet allowed_within_authority(Code) | | Those characters that are allowed for the authority component.
|
allowed_within_path | final public static BitSet allowed_within_path(Code) | | Those characters that are allowed within the path.
|
allowed_within_query | final public static BitSet allowed_within_query(Code) | | Those characters that are allowed within the query component.
|
allowed_within_userinfo | final public static BitSet allowed_within_userinfo(Code) | | Those characters that are allowed for within the userinfo component.
|
alpha | final protected static BitSet alpha(Code) | | BitSet for alpha.
alpha = lowalpha | upalpha
|
alphanum | final protected static BitSet alphanum(Code) | | BitSet for alphanum (join of alpha & digit).
alphanum = alpha | digit
|
authority | final protected static BitSet authority(Code) | | BitSet for authority.
authority = server | reg_name
|
control | final public static BitSet control(Code) | | BitSet for control.
|
defaultDocumentCharset | protected static String defaultDocumentCharset(Code) | | The default charset of the document. RFC 2277, 2396
The platform's charset is used for the document by default.
|
defaultDocumentCharsetByLocale | protected static String defaultDocumentCharsetByLocale(Code) | | |
defaultDocumentCharsetByPlatform | protected static String defaultDocumentCharsetByPlatform(Code) | | |
defaultProtocolCharset | protected static String defaultProtocolCharset(Code) | | The default charset of the protocol. RFC 2277, 2396
|
delims | final public static BitSet delims(Code) | | BitSet for delims.
|
digit | final protected static BitSet digit(Code) | | BitSet for digit.
digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" |
"8" | "9"
|
disallowed_opaque_part | final public static BitSet disallowed_opaque_part(Code) | | Disallowed opaque_part before escaping.
|
disallowed_rel_path | final public static BitSet disallowed_rel_path(Code) | | Disallowed rel_path before escaping.
|
domainlabel | final protected static BitSet domainlabel(Code) | | BitSet for domainlabel.
domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
|
escaped | final protected static BitSet escaped(Code) | | BitSet for escaped.
escaped = "%" hex hex
|
fragment | final protected static BitSet fragment(Code) | | BitSet for fragment (alias for uric).
fragment = *uric
|
hash | protected int hash(Code) | | Cache the hash code for this URI.
|
hex | final protected static BitSet hex(Code) | | BitSet for hex.
hex = digit | "A" | "B" | "C" | "D" | "E" | "F" |
"a" | "b" | "c" | "d" | "e" | "f"
|
hier_part | final protected static BitSet hier_part(Code) | | BitSet for hier_part.
hier_part = ( net_path | abs_path ) [ "?" query ]
|
host | final protected static BitSet host(Code) | | BitSet for host.
host = hostname | IPv4address | IPv6reference
|
hostname | final protected static BitSet hostname(Code) | | BitSet for hostname.
hostname = *( domainlabel "." ) toplabel [ "." ]
|
hostport | final protected static BitSet hostport(Code) | | BitSet for hostport.
hostport = host [ ":" port ]
|
mark | final protected static BitSet mark(Code) | | BitSet for mark.
mark = "-" | "_" | "." | "!" | "~" | "*" | "'" |
"(" | ")"
|
net_path | final protected static BitSet net_path(Code) | | BitSet for net_path.
net_path = "//" authority [ abs_path ]
|
opaque_part | final protected static BitSet opaque_part(Code) | | URI bitset that combines uric_no_slash and uric.
opaque_part = uric_no_slash *uric
|
param | final protected static BitSet param(Code) | | BitSet for param (alias for pchar).
param = *pchar
|
path | final protected static BitSet path(Code) | | URI bitset that combines absolute path and opaque part.
path = [ abs_path | opaque_part ]
|
path_segments | final protected static BitSet path_segments(Code) | | BitSet for path segments.
path_segments = segment *( "/" segment )
|
pchar | final protected static BitSet pchar(Code) | | BitSet for pchar.
pchar = unreserved | escaped |
":" | "@" | "&" | "=" | "+" | "$" | ","
|
percent | final protected static BitSet percent(Code) | | The percent "%" character always has the reserved purpose of being the
escape indicator, it must be escaped as "%25" in order to be used as
data within a URI.
|
port | final protected static BitSet port(Code) | | Port, a logical alias for digit.
|
protocolCharset | protected String protocolCharset(Code) | | The charset of the protocol used by this URI instance.
|
query | final protected static BitSet query(Code) | | BitSet for query (alias for uric).
query = *uric
|
reg_name | final protected static BitSet reg_name(Code) | | BitSet for reg_name.
reg_name = 1*( unreserved | escaped | "$" | "," |
";" | ":" | "@" | "&" | "=" | "+" )
|
rel_path | final protected static BitSet rel_path(Code) | | BitSet for rel_path.
rel_path = rel_segment [ abs_path ]
|
rel_segment | final protected static BitSet rel_segment(Code) | | BitSet for rel_segment.
rel_segment = 1*( unreserved | escaped |
";" | "@" | "&" | "=" | "+" | "$" | "," )
|
relativeURI | final protected static BitSet relativeURI(Code) | | BitSet for relativeURI.
relativeURI = ( net_path | abs_path | rel_path ) [ "?" query ]
|
reserved | final protected static BitSet reserved(Code) | | BitSet for reserved.
reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
"$" | ","
|
rootPath | final protected static char[] rootPath(Code) | | The root path.
|
scheme | final protected static BitSet scheme(Code) | | BitSet for scheme.
scheme = alpha *( alpha | digit | "+" | "-" | "." )
|
segment | final protected static BitSet segment(Code) | | BitSet for segment.
segment = *pchar *( ";" param )
|
serialVersionUID | final static long serialVersionUID(Code) | | Version ID for serialization
|
server | final protected static BitSet server(Code) | | Bitset for server.
server = [ [ userinfo "@" ] hostport ]
|
space | final public static BitSet space(Code) | | BitSet for space.
|
toplabel | final protected static BitSet toplabel(Code) | | BitSet for toplabel.
toplabel = alpha | alpha *( alphanum | "-" ) alphanum
|
unreserved | final protected static BitSet unreserved(Code) | | Data characters that are allowed in a URI but do not have a reserved
purpose are called unreserved.
unreserved = alphanum | mark
|
unwise | final public static BitSet unwise(Code) | | BitSet for unwise.
|
uric | final protected static BitSet uric(Code) | | BitSet for uric.
uric = reserved | unreserved | escaped
|
uric_no_slash | final protected static BitSet uric_no_slash(Code) | | URI bitset for encoding typical non-slash characters.
uric_no_slash = unreserved | escaped | ";" | "?" | ":" | "@" |
"&" | "=" | "+" | "$" | ","
|
userinfo | final protected static BitSet userinfo(Code) | | Bitset for userinfo.
userinfo = *( unreserved | escaped |
";" | ":" | "&" | "=" | "+" | "$" | "," )
|
within_userinfo | final public static BitSet within_userinfo(Code) | | BitSet for within the userinfo component like user and password.
|
URI | protected URI()(Code) | | Create an instance as an internal use
|
URI | public URI(String s, boolean escaped, String charset) throws URIException, NullPointerException(Code) | | Construct a URI from a string with the given charset. The input string can
be either in escaped or unescaped form.
Parameters: s - URI character sequence Parameters: escaped - true if URI character sequence is in escaped form. false otherwise. Parameters: charset - the charset string to do escape encoding, if required throws: URIException - If the URI cannot be created. throws: NullPointerException - if input string is null See Also: URI.getProtocolCharset since: 3.0 |
URI | public URI(String original, String charset) throws URIException(Code) | | Construct a URI from the given string with the given charset.
Parameters: original - the string to be represented to URI character sequenceIt is one of absoluteURI and relativeURI. Parameters: charset - the charset string to do escape encoding throws: URIException - If the URI cannot be created. See Also: URI.getProtocolCharset |
URI | public URI(String original) throws URIException(Code) | | Construct a URI from the given string.
URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
An URI can be placed within double-quotes or angle brackets like
"http://test.com/" and <http://test.com/>
Parameters: original - the string to be represented to URI character sequenceIt is one of absoluteURI and relativeURI. throws: URIException - If the URI cannot be created. See Also: URI.getDefaultProtocolCharset |
URI | public URI(String scheme, String schemeSpecificPart, String fragment) throws URIException(Code) | | Construct a general URI from the given components.
URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
absoluteURI = scheme ":" ( hier_part | opaque_part )
opaque_part = uric_no_slash *uric
It's for absolute URI = <scheme>:<scheme-specific-part>#
<fragment>.
Parameters: scheme - the scheme string Parameters: schemeSpecificPart - scheme_specific_part Parameters: fragment - the fragment string throws: URIException - If the URI cannot be created. See Also: URI.getDefaultProtocolCharset |
URI | public URI(String scheme, String authority, String path, String query, String fragment) throws URIException(Code) | | Construct a general URI from the given components.
URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
absoluteURI = scheme ":" ( hier_part | opaque_part )
relativeURI = ( net_path | abs_path | rel_path ) [ "?" query ]
hier_part = ( net_path | abs_path ) [ "?" query ]
It's for absolute URI = <scheme>:<path>?<query>#<
fragment> and relative URI = <path>?<query>#<fragment
>.
Parameters: scheme - the scheme string Parameters: authority - the authority string Parameters: path - the path string Parameters: query - the query string Parameters: fragment - the fragment string throws: URIException - If the new URI cannot be created. See Also: URI.getDefaultProtocolCharset |
URI | public URI(String scheme, String userinfo, String host, int port) throws URIException(Code) | | Construct a general URI from the given components.
Parameters: scheme - the scheme string Parameters: userinfo - the userinfo string Parameters: host - the host string Parameters: port - the port number throws: URIException - If the new URI cannot be created. See Also: URI.getDefaultProtocolCharset |
URI | public URI(String scheme, String userinfo, String host, int port, String path) throws URIException(Code) | | Construct a general URI from the given components.
Parameters: scheme - the scheme string Parameters: userinfo - the userinfo string Parameters: host - the host string Parameters: port - the port number Parameters: path - the path string throws: URIException - If the new URI cannot be created. See Also: URI.getDefaultProtocolCharset |
URI | public URI(String scheme, String userinfo, String host, int port, String path, String query) throws URIException(Code) | | Construct a general URI from the given components.
Parameters: scheme - the scheme string Parameters: userinfo - the userinfo string Parameters: host - the host string Parameters: port - the port number Parameters: path - the path string Parameters: query - the query string throws: URIException - If the new URI cannot be created. See Also: URI.getDefaultProtocolCharset |
URI | public URI(String scheme, String userinfo, String host, int port, String path, String query, String fragment) throws URIException(Code) | | Construct a general URI from the given components.
Parameters: scheme - the scheme string Parameters: userinfo - the userinfo string Parameters: host - the host string Parameters: port - the port number Parameters: path - the path string Parameters: query - the query string Parameters: fragment - the fragment string throws: URIException - If the new URI cannot be created. See Also: URI.getDefaultProtocolCharset |
URI | public URI(URI base, String relative) throws URIException(Code) | | Construct a general URI with the given relative URI string.
Parameters: base - the base URI Parameters: relative - the relative URI string throws: URIException - If the new URI cannot be created. |
URI | public URI(URI base, String relative, boolean escaped) throws URIException(Code) | | Construct a general URI with the given relative URI string.
Parameters: base - the base URI Parameters: relative - the relative URI string Parameters: escaped - true if URI character sequence is in escaped form. false otherwise. throws: URIException - If the new URI cannot be created. since: 3.0 |
URI | public URI(URI base, URI relative) throws URIException(Code) | | Construct a general URI with the given relative URI.
URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
relativeURI = ( net_path | abs_path | rel_path ) [ "?" query ]
Resolving Relative References to Absolute Form.
Examples of Resolving Relative URI References
Within an object with a well-defined base URI of
http://a/b/c/d;p?q
the relative URI would be resolved as follows:
Normal Examples
g:h = g:h
g = http://a/b/c/g
./g = http://a/b/c/g
g/ = http://a/b/c/g/
/g = http://a/g
//g = http://g
?y = http://a/b/c/?y
g?y = http://a/b/c/g?y
#s = (current document)#s
g#s = http://a/b/c/g#s
g?y#s = http://a/b/c/g?y#s
;x = http://a/b/c/;x
g;x = http://a/b/c/g;x
g;x?y#s = http://a/b/c/g;x?y#s
. = http://a/b/c/
./ = http://a/b/c/
.. = http://a/b/
../ = http://a/b/
../g = http://a/b/g
../.. = http://a/
../../ = http://a/
../../g = http://a/g
Some URI schemes do not allow a hierarchical syntax matching the
syntax, and thus cannot use relative references.
Parameters: base - the base URI Parameters: relative - the relative URI throws: URIException - If the new URI cannot be created. |
clone | public synchronized Object clone() throws CloneNotSupportedException(Code) | | Create and return a copy of this object, the URI-reference containing
the userinfo component. Notice that the whole URI-reference including
the userinfo component counld not be gotten as a String .
To copy the identical URI object including the userinfo
component, it should be used.
a clone of this instance |
compareTo | public int compareTo(Object obj) throws ClassCastException(Code) | | Compare this URI to another object.
Parameters: obj - the object to be compared. 0, if it's same,-1, if failed, first being compared with in the authority component throws: ClassCastException - not URI argument |
decode | protected static String decode(char[] component, String charset) throws URIException(Code) | | Decodes URI encoded string.
This is a two mapping, one from URI characters to octets, and
subsequently a second from octets to original characters:
URI character sequence->octet sequence->original character sequence
A URI must be separated into its components before the escaped
characters within those components can be allowedly decoded.
Notice that there is a chance that URI characters that are non UTF-8
may be parsed as valid UTF-8. A recent non-scientific analysis found
that EUC encoded Japanese words had a 2.7% false reading; SJIS had a
0.0005% false reading; other encoding such as ASCII or KOI-8 have a 0%
false reading.
The percent "%" character always has the reserved purpose of being
the escape indicator, it must be escaped as "%25" in order to be used
as data within a URI.
The unescape method is internally performed within this method.
Parameters: component - the URI character sequence Parameters: charset - the protocol charset original character sequence throws: URIException - incomplete trailing escape pattern or unsupportedcharacter encoding |
decode | protected static String decode(String component, String charset) throws URIException(Code) | | Decodes URI encoded string.
This is a two mapping, one from URI characters to octets, and
subsequently a second from octets to original characters:
URI character sequence->octet sequence->original character sequence
A URI must be separated into its components before the escaped
characters within those components can be allowedly decoded.
Notice that there is a chance that URI characters that are non UTF-8
may be parsed as valid UTF-8. A recent non-scientific analysis found
that EUC encoded Japanese words had a 2.7% false reading; SJIS had a
0.0005% false reading; other encoding such as ASCII or KOI-8 have a 0%
false reading.
The percent "%" character always has the reserved purpose of being
the escape indicator, it must be escaped as "%25" in order to be used
as data within a URI.
The unescape method is internally performed within this method.
Parameters: component - the URI character sequence Parameters: charset - the protocol charset original character sequence throws: URIException - incomplete trailing escape pattern or unsupportedcharacter encoding since: 3.0 |
encode | protected static char[] encode(String original, BitSet allowed, String charset) throws URIException(Code) | | Encodes URI string.
This is a two mapping, one from original characters to octets, and
subsequently a second from octets to URI characters:
original character sequence->octet sequence->URI character sequence
An escaped octet is encoded as a character triplet, consisting of the
percent character "%" followed by the two hexadecimal digits
representing the octet code. For example, "%20" is the escaped
encoding for the US-ASCII space character.
Conversion from the local filesystem character set to UTF-8 will
normally involve a two step process. First convert the local character
set to the UCS; then convert the UCS to UTF-8.
The first step in the process can be performed by maintaining a mapping
table that includes the local character set code and the corresponding
UCS code.
The next step is to convert the UCS character code to the UTF-8 encoding.
Mapping between vendor codepages can be done in a very similar manner
as described above.
The only time escape encodings can allowedly be made is when a URI is
being created from its component parts. The escape and validate methods
are internally performed within this method.
Parameters: original - the original character sequence Parameters: allowed - those characters that are allowed within a component Parameters: charset - the protocol charset URI character sequence throws: URIException - null component or unsupported character encoding |
equals | protected boolean equals(char[] first, char[] second)(Code) | | Test if the first array is equal to the second array.
Parameters: first - the first character array Parameters: second - the second character array true if they're equal |
equals | public boolean equals(Object obj)(Code) | | Test an object if this URI is equal to another.
Parameters: obj - an object to compare true if two URI objects are equal |
getDefaultDocumentCharset | public static String getDefaultDocumentCharset()(Code) | | Get the recommended default charset of the document.
the default charset string |
getDefaultDocumentCharsetByLocale | public static String getDefaultDocumentCharsetByLocale()(Code) | | Get the default charset of the document by locale.
the default charset string by locale |
getDefaultDocumentCharsetByPlatform | public static String getDefaultDocumentCharsetByPlatform()(Code) | | Get the default charset of the document by platform.
the default charset string by platform |
getDefaultProtocolCharset | public static String getDefaultProtocolCharset()(Code) | | Get the default charset of the protocol.
An individual URI scheme may require a single charset, define a default
charset, or provide a way to indicate the charset used.
To work globally either requires support of a number of character sets
and to be able to convert between them, or the use of a single preferred
character set.
For support of global compatibility it is STRONGLY RECOMMENDED that
clients and servers use UTF-8 encoding when exchanging URIs.
the default charset string |
getEscapedAuthority | public String getEscapedAuthority()(Code) | | Get the escaped authority.
the escaped authority |
getEscapedFragment | public String getEscapedFragment()(Code) | | Get the escaped fragment.
the escaped fragment string |
getEscapedName | public String getEscapedName()(Code) | | Get the escaped basename of the path.
the escaped basename string |
getEscapedPath | public String getEscapedPath()(Code) | | Get the escaped path.
path = [ abs_path | opaque_part ]
abs_path = "/" path_segments
opaque_part = uric_no_slash *uric
the escaped path string |
getEscapedPathQuery | public String getEscapedPathQuery()(Code) | | Get the escaped query.
the escaped path and query string |
getEscapedQuery | public String getEscapedQuery()(Code) | | Get the escaped query.
the escaped query string |
getEscapedURI | public String getEscapedURI()(Code) | | It can be gotten the URI character sequence. It's escaped.
For the purpose of the protocol to be transported, it will be useful.
the escaped URI string |
getEscapedURIReference | public String getEscapedURIReference()(Code) | | Get the escaped URI reference string.
the escaped URI reference string |
getPort | public int getPort()(Code) | | Get the port. In order to get the specfic default port, the specific
protocol-supported class extended from the URI class should be used.
It has the server-based naming authority.
the portif -1, it has the default port for the scheme or the server-basednaming authority is not supported in the specific URI. |
getProtocolCharset | public String getProtocolCharset()(Code) | | Get the protocol charset used by this current URI instance.
It was set by the constructor for this instance. If it was not set by
contructor, it will return the default protocol charset.
the protocol charset string See Also: URI.getDefaultProtocolCharset |
getRawAuthority | public char[] getRawAuthority()(Code) | | Get the raw-escaped authority.
the raw-escaped authority |
getRawCurrentHierPath | protected char[] getRawCurrentHierPath(char[] path) throws URIException(Code) | | Get the raw-escaped current hierarchy level in the given path.
If the last namespace is a collection, the slash mark ('/') should be
ended with at the last character of the path string.
Parameters: path - the path the current hierarchy level throws: URIException - no hierarchy level |
getRawFragment | public char[] getRawFragment()(Code) | | Get the raw-escaped fragment.
The optional fragment identifier is not part of a URI, but is often used
in conjunction with a URI.
The format and interpretation of fragment identifiers is dependent on
the media type [RFC2046] of the retrieval result.
A fragment identifier is only meaningful when a URI reference is
intended for retrieval and the result of that retrieval is a document
for which the identified fragment is consistently defined.
the raw-escaped fragment |
getRawHost | public char[] getRawHost()(Code) | | Get the host.
host = hostname | IPv4address | IPv6reference
the host See Also: URI.getAuthority |
getRawName | public char[] getRawName()(Code) | | Get the raw-escaped basename of the path.
the raw-escaped basename |
getRawPath | public char[] getRawPath()(Code) | | Get the raw-escaped path.
path = [ abs_path | opaque_part ]
the raw-escaped path |
getRawPathQuery | public char[] getRawPathQuery()(Code) | | Get the raw-escaped path and query.
the raw-escaped path and query |
getRawQuery | public char[] getRawQuery()(Code) | | Get the raw-escaped query.
the raw-escaped query |
getRawScheme | public char[] getRawScheme()(Code) | | Get the scheme.
the scheme |
getRawURI | public char[] getRawURI()(Code) | | It can be gotten the URI character sequence. It's raw-escaped.
For the purpose of the protocol to be transported, it will be useful.
It is clearly unwise to use a URL that contains a password which is
intended to be secret. In particular, the use of a password within
the 'userinfo' component of a URL is strongly disrecommended except
in those rare cases where the 'password' parameter is intended to be
public.
When you want to get each part of the userinfo, you need to use the
specific methods in the specific URL. It depends on the specific URL.
the URI character sequence |
getRawURIReference | public char[] getRawURIReference()(Code) | | Get the URI reference character sequence.
the URI reference character sequence |
getRawUserinfo | public char[] getRawUserinfo()(Code) | | Get the raw-escaped userinfo.
the raw-escaped userinfo See Also: URI.getAuthority |
getScheme | public String getScheme()(Code) | | Get the scheme.
the schemenull if undefined scheme |
getURI | public String getURI() throws URIException(Code) | | It can be gotten the URI character sequence.
the original URI string throws: URIException - incomplete trailing escape pattern or unsupportedcharacter encoding See Also: URI.decode |
hasAuthority | public boolean hasAuthority()(Code) | | Tell whether or not this URI has authority.
It's the same function as the is_net_path() method.
true iif this URI has authority See Also: URI.isNetPath |
hasFragment | public boolean hasFragment()(Code) | | Tell whether or not this URI has fragment.
true iif this URI has fragment |
hasQuery | public boolean hasQuery()(Code) | | Tell whether or not this URI has query.
true iif this URI has query |
hasUserinfo | public boolean hasUserinfo()(Code) | | Tell whether or not this URI has userinfo.
true iif this URI has userinfo |
hashCode | public int hashCode()(Code) | | Return a hash code for this URI.
a has code value for this URI |
indexFirstOf | protected int indexFirstOf(String s, String delims)(Code) | | Get the earlier index that to be searched for the first occurrance in
one of any of the given string.
Parameters: s - the string to be indexed Parameters: delims - the delimiters used to index the earlier index if there are delimiters |
indexFirstOf | protected int indexFirstOf(String s, String delims, int offset)(Code) | | Get the earlier index that to be searched for the first occurrance in
one of any of the given string.
Parameters: s - the string to be indexed Parameters: delims - the delimiters used to index Parameters: offset - the from index the earlier index if there are delimiters |
indexFirstOf | protected int indexFirstOf(char[] s, char delim)(Code) | | Get the earlier index that to be searched for the first occurrance in
one of any of the given array.
Parameters: s - the character array to be indexed Parameters: delim - the delimiter used to index the ealier index if there are a delimiter |
indexFirstOf | protected int indexFirstOf(char[] s, char delim, int offset)(Code) | | Get the earlier index that to be searched for the first occurrance in
one of any of the given array.
Parameters: s - the character array to be indexed Parameters: delim - the delimiter used to index Parameters: offset - The offset. the ealier index if there is a delimiter |
isAbsPath | public boolean isAbsPath()(Code) | | Tell whether or not the relativeURI or hier_part of this URI is abs_path.
true iif the relativeURI or hier_part is abs_path |
isAbsoluteURI | public boolean isAbsoluteURI()(Code) | | Tell whether or not this URI is absolute.
true iif this URI is absoluteURI |
isHierPart | public boolean isHierPart()(Code) | | Tell whether or not the absoluteURI of this URI is hier_part.
true iif the absoluteURI is hier_part |
isHostname | public boolean isHostname()(Code) | | Tell whether or not the host part of this URI is hostname.
true iif the host part is hostname |
isIPv4address | public boolean isIPv4address()(Code) | | Tell whether or not the host part of this URI is IPv4address.
true iif the host part is IPv4address |
isIPv6reference | public boolean isIPv6reference()(Code) | | Tell whether or not the host part of this URI is IPv6reference.
true iif the host part is IPv6reference |
isNetPath | public boolean isNetPath()(Code) | | Tell whether or not the relativeURI or heir_part of this URI is net_path.
It's the same function as the has_authority() method.
true iif the relativeURI or heir_part is net_path See Also: URI.hasAuthority |
isOpaquePart | public boolean isOpaquePart()(Code) | | Tell whether or not the absoluteURI of this URI is opaque_part.
true iif the absoluteURI is opaque_part |
isRegName | public boolean isRegName()(Code) | | Tell whether or not the authority component of this URI is reg_name.
true iif the authority component is reg_name |
isRelPath | public boolean isRelPath()(Code) | | Tell whether or not the relativeURI of this URI is rel_path.
true iif the relativeURI is rel_path |
isRelativeURI | public boolean isRelativeURI()(Code) | | Tell whether or not this URI is relative.
true iif this URI is relativeURI |
isServer | public boolean isServer()(Code) | | Tell whether or not the authority component of this URI is server.
true iif the authority component is server |
normalize | protected char[] normalize(char[] path) throws URIException(Code) | | Normalize the given hier path part.
Algorithm taken from URI reference parser at
http://www.apache.org/~fielding/uri/rev-2002/issues.html.
Parameters: path - the path to normalize the normalized path throws: URIException - no more higher path level to be normalized |
normalize | public void normalize() throws URIException(Code) | | Normalizes the path part of this URI. Normalization is only meant to be performed on
URIs with an absolute path. Calling this method on a relative path URI will have no
effect.
throws: URIException - no more higher path level to be normalized See Also: URI.isAbsPath() |
parseAuthority | protected void parseAuthority(String original, boolean escaped) throws URIException(Code) | | Parse the authority component.
Parameters: original - the original character sequence of authority component Parameters: escaped - true if original is escaped throws: URIException - If an error occurs. |
parseUriReference | protected void parseUriReference(String original, boolean escaped) throws URIException(Code) | | In order to avoid any possilbity of conflict with non-ASCII characters,
Parse a URI reference as a String with the character
encoding of the local system or the document.
The following line is the regular expression for breaking-down a URI
reference into its components.
^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?
12 3 4 5 6 7 8 9
For example, matching the above expression to
http://jakarta.apache.org/ietf/uri/#Related
results in the following subexpression matches:
$1 = http:
scheme = $2 = http
$3 = //jakarta.apache.org
authority = $4 = jakarta.apache.org
path = $5 = /ietf/uri/
$6 =
query = $7 =
$8 = #Related
fragment = $9 = Related
Parameters: original - the original character sequence Parameters: escaped - true if original is escaped throws: URIException - If an error occurs. |
prevalidate | protected boolean prevalidate(String component, BitSet disallowed)(Code) | | Pre-validate the unescaped URI string within a specific component.
Parameters: component - the component string within the component Parameters: disallowed - those characters disallowed within the component if true, it doesn't have the disallowed charactersif false, the component is undefined or an incorrect one |
removeFragmentIdentifier | protected char[] removeFragmentIdentifier(char[] component)(Code) | | Remove the fragment identifier of the given component.
Parameters: component - the component that a fragment may be included the component that the fragment identifier is removed |
resolvePath | protected char[] resolvePath(char[] basePath, char[] relPath) throws URIException(Code) | | Resolve the base and relative path.
Parameters: basePath - a character array of the basePath Parameters: relPath - a character array of the relPath the resolved path throws: URIException - no more higher path level to be resolved |
setDefaultDocumentCharset | public static void setDefaultDocumentCharset(String charset) throws DefaultCharsetChanged(Code) | | Set the default charset of the document.
Notice that it will be possible to contain mixed characters (e.g.
ftp://host/KoreanNamespace/ChineseResource). To handle the Bi-directional
display of these character sets, the protocol charset could be simply
used again. Because it's not yet implemented that the insertion of BIDI
control characters at different points during composition is extracted.
Always all the time, the setter method is always succeeded and throws
DefaultCharsetChanged exception.
So API programmer must follow the following way:
import org.apache.util.URI$DefaultCharsetChanged;
.
.
.
try {
URI.setDefaultDocumentCharset("EUC-KR");
} catch (DefaultCharsetChanged cc) {
// CASE 1: the exception could be ignored, when it is set by user
if (cc.getReasonCode() == DefaultCharsetChanged.DOCUMENT_CHARSET) {
// CASE 2: let user know the default document charset changed
} else {
// CASE 2: let user know the default protocol charset changed
}
}
The API programmer is responsible to set the correct charset.
And each application should remember its own charset to support.
Parameters: charset - the default charset for the document throws: DefaultCharsetChanged - default charset changed |
setDefaultProtocolCharset | public static void setDefaultProtocolCharset(String charset) throws DefaultCharsetChanged(Code) | | Set the default charset of the protocol.
The character set used to store files SHALL remain a local decision and
MAY depend on the capability of local operating systems. Prior to the
exchange of URIs they SHOULD be converted into a ISO/IEC 10646 format
and UTF-8 encoded. This approach, while allowing international exchange
of URIs, will still allow backward compatibility with older systems
because the code set positions for ASCII characters are identical to the
one byte sequence in UTF-8.
An individual URI scheme may require a single charset, define a default
charset, or provide a way to indicate the charset used.
Always all the time, the setter method is always succeeded and throws
DefaultCharsetChanged exception.
So API programmer must follow the following way:
import org.apache.util.URI$DefaultCharsetChanged;
.
.
.
try {
URI.setDefaultProtocolCharset("UTF-8");
} catch (DefaultCharsetChanged cc) {
// CASE 1: the exception could be ignored, when it is set by user
if (cc.getReasonCode() == DefaultCharsetChanged.PROTOCOL_CHARSET) {
// CASE 2: let user know the default protocol charset changed
} else {
// CASE 2: let user know the default document charset changed
}
}
The API programmer is responsible to set the correct charset.
And each application should remember its own charset to support.
Parameters: charset - the default charset for each protocol throws: DefaultCharsetChanged - default charset changed |
setEscapedAuthority | public void setEscapedAuthority(String escapedAuthority) throws URIException(Code) | | Set the authority. It can be one type of server, hostport, hostname,
IPv4address, IPv6reference and reg_name.
Note that there is no setAuthority method by the escape encoding reason.
Parameters: escapedAuthority - the escaped authority string throws: URIException - If URI.parseAuthority(java.lang.String,boolean) fails |
setEscapedFragment | public void setEscapedFragment(String escapedFragment) throws URIException(Code) | | Set the escaped fragment string.
Parameters: escapedFragment - the escaped fragment string throws: URIException - escaped fragment not valid |
setEscapedPath | public void setEscapedPath(String escapedPath) throws URIException(Code) | | Set the escaped path.
Parameters: escapedPath - the escaped path string throws: URIException - encoding error or not proper for initial instance See Also: URI.encode |
setEscapedQuery | public void setEscapedQuery(String escapedQuery) throws URIException(Code) | | Set the escaped query string.
Parameters: escapedQuery - the escaped query string throws: URIException - escaped query not valid |
setFragment | public void setFragment(String fragment) throws URIException(Code) | | Set the fragment.
Parameters: fragment - the fragment string. throws: URIException - If an error occurs. |
setQuery | public void setQuery(String query) throws URIException(Code) | | Set the query.
When a query string is not misunderstood the reserved special characters
("&", "=", "+", ",", and "$") within a query component, it is
recommended to use in encoding the whole query with this method.
The additional APIs for the special purpose using by the reserved
special characters used in each protocol are implemented in each protocol
classes inherited from URI . So refer to the same-named APIs
implemented in each specific protocol instance.
Parameters: query - the query string. throws: URIException - incomplete trailing escape pattern or unsupportedcharacter encoding See Also: URI.encode |
setRawFragment | public void setRawFragment(char[] escapedFragment) throws URIException(Code) | | Set the raw-escaped fragment.
Parameters: escapedFragment - the raw-escaped fragment throws: URIException - escaped fragment not valid |
setRawPath | public void setRawPath(char[] escapedPath) throws URIException(Code) | | Set the raw-escaped path.
Parameters: escapedPath - the path character sequence throws: URIException - encoding error or not proper for initial instance See Also: URI.encode |
setRawQuery | public void setRawQuery(char[] escapedQuery) throws URIException(Code) | | Set the raw-escaped query.
Parameters: escapedQuery - the raw-escaped query throws: URIException - escaped query not valid |
setURI | protected void setURI()(Code) | | Once it's parsed successfully, set this URI.
See Also: URI.getRawURI |
toString | public String toString()(Code) | | Get the escaped URI string.
On the document, the URI-reference form is only used without the userinfo
component like http://jakarta.apache.org/ by the security reason.
But the URI-reference form with the userinfo component could be parsed.
In other words, this URI and any its subclasses must not expose the
URI-reference expression with the userinfo component like
http://user:password@hostport/restricted_zone.
It means that the API client programmer should extract each user and
password to access manually. Probably it will be supported in the each
subclass, however, not a whole URI-reference expression.
the escaped URI string See Also: URI.clone() |
validate | protected boolean validate(char[] component, BitSet generous)(Code) | | Validate the URI characters within a specific component.
The component must be performed after escape encoding. Or it doesn't
include escaped characters.
Parameters: component - the characters sequence within the component Parameters: generous - those characters that are allowed within a component if true, it's the correct URI character sequence |
validate | protected boolean validate(char[] component, int soffset, int eoffset, BitSet generous)(Code) | | Validate the URI characters within a specific component.
The component must be performed after escape encoding. Or it doesn't
include escaped characters.
It's not that much strict, generous. The strict validation might be
performed before being called this method.
Parameters: component - the characters sequence within the component Parameters: soffset - the starting offset of the given component Parameters: eoffset - the ending offset of the given componentif -1, it means the length of the component Parameters: generous - those characters that are allowed within a component if true, it's the correct URI character sequence |
|
|