org.apache.commons.httpclient
Class URI

java.lang.Object
  extended by org.apache.commons.httpclient.URI
All Implemented Interfaces:
Serializable, Cloneable, Comparable
Direct Known Subclasses:
HttpURL, URIUtil.Coder


public class URI
extends Object
implements Cloneable, Comparable, Serializable

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

See Also:
Serialized Form

Nested Class Summary
static class URI.DefaultCharsetChanged
          The charset-changed normal operation to represent to be required to alert to user the fact the default charset is changed.
static class URI.LocaleToCharsetMap
          A mapping to determine the (somewhat arbitrarily) preferred charset for a given locale.
 
Field Summary
protected  char[] _authority
          The authority.
protected  char[] _fragment
          The fragment.
protected  char[] _host
          The host.
protected  boolean _is_abs_path
           
protected  boolean _is_hier_part
           
protected  boolean _is_hostname
           
protected  boolean _is_IPv4address
           
protected  boolean _is_IPv6reference
           
protected  boolean _is_net_path
           
protected  boolean _is_opaque_part
           
protected  boolean _is_reg_name
           
protected  boolean _is_rel_path
           
protected  boolean _is_server
           
protected  char[] _opaque
          The opaque.
protected  char[] _path
          The path.
protected  int _port
          The port.
protected  char[] _query
          The query.
protected  char[] _scheme
          The scheme.
protected  char[] _uri
          This Uniform Resource Identifier (URI).
protected  char[] _userinfo
          The userinfo.
protected static BitSet abs_path
          URI absolute path.
protected static BitSet absoluteURI
          BitSet for absoluteURI.
static BitSet allowed_abs_path
          Those characters that are allowed for the abs_path.
static BitSet allowed_authority
          Those characters that are allowed for the authority component.
static BitSet allowed_fragment
          Those characters that are allowed for the fragment component.
static BitSet allowed_host
          Those characters that are allowed for the host component.
static BitSet allowed_IPv6reference
          Those characters that are allowed for the IPv6reference component.
static BitSet allowed_opaque_part
          Those characters that are allowed for the opaque_part.
static BitSet allowed_query
          Those characters that are allowed for the query component.
static BitSet allowed_reg_name
          Those characters that are allowed for the reg_name.
static BitSet allowed_rel_path
          Those characters that are allowed for the rel_path.
static BitSet allowed_userinfo
          Those characters that are allowed for the userinfo component.
static BitSet allowed_within_authority
          Those characters that are allowed for the authority component.
static BitSet allowed_within_path
          Those characters that are allowed within the path.
static BitSet allowed_within_query
          Those characters that are allowed within the query component.
static BitSet allowed_within_userinfo
          Those characters that are allowed for within the userinfo component.
protected static BitSet alpha
          BitSet for alpha.
protected static BitSet alphanum
          BitSet for alphanum (join of alpha & digit).
protected static BitSet authority
          BitSet for authority.
static BitSet control
          BitSet for control.
protected static String defaultDocumentCharset
          The default charset of the document.
protected static String defaultDocumentCharsetByLocale
           
protected static String defaultDocumentCharsetByPlatform
           
protected static String defaultProtocolCharset
          The default charset of the protocol.
static BitSet delims
          BitSet for delims.
protected static BitSet digit
          BitSet for digit.
static BitSet disallowed_opaque_part
          Disallowed opaque_part before escaping.
static BitSet disallowed_rel_path
          Disallowed rel_path before escaping.
protected static BitSet domainlabel
          BitSet for domainlabel.
protected static BitSet escaped
          BitSet for escaped.
protected static BitSet fragment
          BitSet for fragment (alias for uric).
protected  int hash
          Cache the hash code for this URI.
protected static BitSet hex
          BitSet for hex.
protected static BitSet hier_part
          BitSet for hier_part.
protected static BitSet host
          BitSet for host.
protected static BitSet hostname
          BitSet for hostname.
protected static BitSet hostport
          BitSet for hostport.
protected static BitSet IPv4address
          Bitset that combines digit and dot fo IPv$address.
protected static BitSet IPv6address
          RFC 2373.
protected static BitSet IPv6reference
          RFC 2732, 2373.
protected static BitSet mark
          BitSet for mark.
protected static BitSet net_path
          BitSet for net_path.
protected static BitSet opaque_part
          URI bitset that combines uric_no_slash and uric.
protected static BitSet param
          BitSet for param (alias for pchar).
protected static BitSet path
          URI bitset that combines absolute path and opaque part.
protected static BitSet path_segments
          BitSet for path segments.
protected static BitSet pchar
          BitSet for pchar.
protected static BitSet percent
          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.
protected static BitSet port
          Port, a logical alias for digit.
protected  String protocolCharset
          The charset of the protocol used by this URI instance.
protected static BitSet query
          BitSet for query (alias for uric).
protected static BitSet reg_name
          BitSet for reg_name.
protected static BitSet rel_path
          BitSet for rel_path.
protected static BitSet rel_segment
          BitSet for rel_segment.
protected static BitSet relativeURI
          BitSet for relativeURI.
protected static BitSet reserved
          BitSet for reserved.
protected static char[] rootPath
          The root path.
protected static BitSet scheme
          BitSet for scheme.
protected static BitSet segment
          BitSet for segment.
protected static BitSet server
          Bitset for server.
static BitSet space
          BitSet for space.
protected static BitSet toplabel
          BitSet for toplabel.
protected static BitSet unreserved
          Data characters that are allowed in a URI but do not have a reserved purpose are called unreserved.
static BitSet unwise
          BitSet for unwise.
protected static BitSet URI_reference
          BitSet for URI-reference.
protected static BitSet uric
          BitSet for uric.
protected static BitSet uric_no_slash
          URI bitset for encoding typical non-slash characters.
protected static BitSet userinfo
          Bitset for userinfo.
static BitSet within_userinfo
          BitSet for within the userinfo component like user and password.
 
Constructor Summary
protected URI()
          Create an instance as an internal use
  URI(char[] escaped)
          Construct a URI as an escaped form of a character array.
  URI(char[] escaped, String charset)
          Construct a URI as an escaped form of a character array with the given charset.
  URI(String original)
          Construct a URI from the given string.
  URI(String original, String charset)
          Construct a URI from the given string with the given charset.
  URI(String scheme, String schemeSpecificPart, String fragment)
          Construct a general URI from the given components.
  URI(String scheme, String userinfo, String host, int port)
          Construct a general URI from the given components.
  URI(String scheme, String userinfo, String host, int port, String path)
          Construct a general URI from the given components.
  URI(String scheme, String userinfo, String host, int port, String path, String query)
          Construct a general URI from the given components.
  URI(String scheme, String userinfo, String host, int port, String path, String query, String fragment)
          Construct a general URI from the given components.
  URI(String scheme, String host, String path, String fragment)
          Construct a general URI from the given components.
  URI(String scheme, String authority, String path, String query, String fragment)
          Construct a general URI from the given components.
  URI(URI base, String relative)
          Construct a general URI with the given relative URI string.
  URI(URI base, URI relative)
          Construct a general URI with the given relative URI.
  URI(URL url)
          Deprecated. currently somewhat wrong and diffrent with java.net.URL usage
 
Method Summary
 Object clone()
          Create and return a copy of this object, the URI-reference containing the userinfo component.
 int compareTo(Object obj)
          Compare this URI to another object.
protected static String decode(char[] component, String charset)
          Decodes URI encoded string.
protected static char[] encode(String original, BitSet allowed, String charset)
          Encodes URI string.
protected  boolean equals(char[] first, char[] second)
          Test if the first array is equal to the second array.
 boolean equals(Object obj)
          Test an object if this URI is equal to another.
 String getAboveHierPath()
          Get the level above the this hierarchy level.
 String getAuthority()
          Get the authority.
 String getCurrentHierPath()
          Get the current hierarchy level.
static String getDefaultDocumentCharset()
          Get the recommended default charset of the document.
static String getDefaultDocumentCharsetByLocale()
          Get the default charset of the document by locale.
static String getDefaultDocumentCharsetByPlatform()
          Get the default charset of the document by platform.
static String getDefaultProtocolCharset()
          Get the default charset of the protocol.
 String getEscapedAboveHierPath()
          Get the level above the this hierarchy level.
 String getEscapedAuthority()
          Get the escaped authority.
 String getEscapedCurrentHierPath()
          Get the escaped current hierarchy level.
 String getEscapedFragment()
          Get the escaped fragment.
 String getEscapedName()
          Get the escaped basename of the path.
 String getEscapedPath()
          Get the escaped path.
 String getEscapedPathQuery()
          Get the escaped query.
 String getEscapedQuery()
          Get the escaped query.
 String getEscapedURI()
          It can be gotten the URI character sequence.
 String getEscapedURIReference()
          Get the escaped URI reference string.
 String getEscapedUserinfo()
          Get the escaped userinfo.
 String getFragment()
          Get the fragment.
 String getHost()
          Get the host.
 String getName()
          Get the basename of the path.
 String getPath()
          Get the path.
 String getPathQuery()
          Get the path and query.
 int getPort()
          Get the port.
 String getProtocolCharset()
          Get the protocol charset used by this current URI instance.
 String getQuery()
          Get the query.
 char[] getRawAboveHierPath()
          Get the level above the this hierarchy level.
 char[] getRawAuthority()
          Get the raw-escaped authority.
 char[] getRawCurrentHierPath()
          Get the raw-escaped current hierarchy level.
protected  char[] getRawCurrentHierPath(char[] path)
          Get the raw-escaped current hierarchy level in the given path.
 char[] getRawFragment()
          Get the raw-escaped fragment.
 char[] getRawHost()
          Get the host.
 char[] getRawName()
          Get the raw-escaped basename of the path.
 char[] getRawPath()
          Get the raw-escaped path.
 char[] getRawPathQuery()
          Get the raw-escaped path and query.
 char[] getRawQuery()
          Get the raw-escaped query.
 char[] getRawScheme()
          Get the scheme.
 char[] getRawURI()
          It can be gotten the URI character sequence.
 char[] getRawURIReference()
          Get the URI reference character sequence.
 char[] getRawUserinfo()
          Get the raw-escaped userinfo.
 String getScheme()
          Get the scheme.
 String getURI()
          It can be gotten the URI character sequence.
 String getURIReference()
          Get the original URI reference string.
 String getUserinfo()
          Get the userinfo.
 boolean hasAuthority()
          Tell whether or not this URI has authority.
 boolean hasFragment()
          Tell whether or not this URI has fragment.
 int hashCode()
          Return a hash code for this URI.
 boolean hasQuery()
          Tell whether or not this URI has query.
 boolean hasUserinfo()
          Tell whether or not this URI has userinfo.
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.
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.
 boolean isAbsoluteURI()
          Tell whether or not this URI is absolute.
 boolean isAbsPath()
          Tell whether or not the relativeURI or hier_part of this URI is abs_path.
 boolean isHierPart()
          Tell whether or not the absoluteURI of this URI is hier_part.
 boolean isHostname()
          Tell whether or not the host part of this URI is hostname.
 boolean isIPv4address()
          Tell whether or not the host part of this URI is IPv4address.
 boolean isIPv6reference()
          Tell whether or not the host part of this URI is IPv6reference.
 boolean isNetPath()
          Tell whether or not the relativeURI or heir_part of this URI is net_path.
 boolean isOpaquePart()
          Tell whether or not the absoluteURI of this URI is opaque_part.
 boolean isRegName()
          Tell whether or not the authority component of this URI is reg_name.
 boolean isRelativeURI()
          Tell whether or not this URI is relative.
 boolean isRelPath()
          Tell whether or not the relativeURI of this URI is rel_path.
 boolean isServer()
          Tell whether or not the authority component of this URI is server.
 void normalize()
          Normalizes the path part of this URI.
protected  char[] normalize(char[] path)
          Normalize the given hier path part.
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.
static void setDefaultDocumentCharset(String charset)
          Set the default charset of the document.
static void setDefaultProtocolCharset(String charset)
          Set the default charset of the protocol.
 void setEscapedAuthority(String escapedAuthority)
          Set the authority.
 void setEscapedFragment(String escapedFragment)
          Set the escaped fragment string.
 void setEscapedPath(String escapedPath)
          Set the escaped path.
 void setEscapedQuery(String escapedQuery)
          Set the escaped query string.
 void setFragment(String fragment)
          Set the fragment.
 void setPath(String path)
          Set the path.
 void setQuery(String query)
          Set the query.
 void setRawAuthority(char[] escapedAuthority)
          Set the authority.
 void setRawFragment(char[] escapedFragment)
          Set the raw-escaped fragment.
 void setRawPath(char[] escapedPath)
          Set the raw-escaped path.
 void setRawQuery(char[] escapedQuery)
          Set the raw-escaped query.
protected  void setURI()
          Once it's parsed successfully, set this URI.
 String toString()
          Get the escaped URI string.
protected  boolean validate(char[] component, BitSet generous)
          Validate the URI characters within a specific component.
protected  boolean validate(char[] component, int soffset, int eoffset, BitSet generous)
          Validate the URI characters within a specific component.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

hash

protected int hash
Cache the hash code for this URI.


_uri

protected char[] _uri
This Uniform Resource Identifier (URI). The URI is always in an "escaped" form, since escaping or unescaping a completed URI might change its semantics.


protocolCharset

protected String protocolCharset
The charset of the protocol used by this URI instance.


defaultProtocolCharset

protected static String defaultProtocolCharset
The default charset of the protocol. RFC 2277, 2396


defaultDocumentCharset

protected static String defaultDocumentCharset
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

defaultDocumentCharsetByPlatform

protected static String defaultDocumentCharsetByPlatform

_scheme

protected char[] _scheme
The scheme.


_opaque

protected char[] _opaque
The opaque.


_authority

protected char[] _authority
The authority.


_userinfo

protected char[] _userinfo
The userinfo.


_host

protected char[] _host
The host.


_port

protected int _port
The port.


_path

protected char[] _path
The path.


_query

protected char[] _query
The query.


_fragment

protected char[] _fragment
The fragment.


rootPath

protected static char[] rootPath
The root path.


percent

protected static final BitSet percent
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.


digit

protected static final BitSet digit
BitSet for digit.

 digit    = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" |
            "8" | "9"
 


alpha

protected static final BitSet alpha
BitSet for alpha.

 alpha         = lowalpha | upalpha
 


alphanum

protected static final BitSet alphanum
BitSet for alphanum (join of alpha & digit).

  alphanum      = alpha | digit
 


hex

protected static final BitSet hex
BitSet for hex.

 hex           = digit | "A" | "B" | "C" | "D" | "E" | "F" |
                         "a" | "b" | "c" | "d" | "e" | "f"
 


escaped

protected static final BitSet escaped
BitSet for escaped.

 escaped       = "%" hex hex
 


mark

protected static final BitSet mark
BitSet for mark.

 mark          = "-" | "_" | "." | "!" | "~" | "*" | "'" |
                 "(" | ")"
 


unreserved

protected static final BitSet unreserved
Data characters that are allowed in a URI but do not have a reserved purpose are called unreserved.

 unreserved    = alphanum | mark
 


reserved

protected static final BitSet reserved
BitSet for reserved.

 reserved      = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
                 "$" | ","
 


uric

protected static final BitSet uric
BitSet for uric.

 uric          = reserved | unreserved | escaped
 


fragment

protected static final BitSet fragment
BitSet for fragment (alias for uric).

 fragment      = *uric
 


query

protected static final BitSet query
BitSet for query (alias for uric).

 query         = *uric
 


pchar

protected static final BitSet pchar
BitSet for pchar.

 pchar         = unreserved | escaped |
                 ":" | "@" | "&" | "=" | "+" | "$" | ","
 


param

protected static final BitSet param
BitSet for param (alias for pchar).

 param         = *pchar
 


segment

protected static final BitSet segment
BitSet for segment.

 segment       = *pchar *( ";" param )
 


path_segments

protected static final BitSet path_segments
BitSet for path segments.

 path_segments = segment *( "/" segment )
 


abs_path

protected static final BitSet abs_path
URI absolute path.

 abs_path      = "/"  path_segments
 


uric_no_slash

protected static final BitSet uric_no_slash
URI bitset for encoding typical non-slash characters.

 uric_no_slash = unreserved | escaped | ";" | "?" | ":" | "@" |
                 "&" | "=" | "+" | "$" | ","
 


opaque_part

protected static final BitSet opaque_part
URI bitset that combines uric_no_slash and uric.

 opaque_part   = uric_no_slash *uric
 


path

protected static final BitSet path
URI bitset that combines absolute path and opaque part.

 path          = [ abs_path | opaque_part ]
 


port

protected static final BitSet port
Port, a logical alias for digit.


IPv4address

protected static final BitSet IPv4address
Bitset that combines digit and dot fo IPv$address.

 IPv4address   = 1*digit "." 1*digit "." 1*digit "." 1*digit
 


IPv6address

protected static final BitSet IPv6address
RFC 2373.

 IPv6address = hexpart [ ":" IPv4address ]
 


IPv6reference

protected static final BitSet IPv6reference
RFC 2732, 2373.

 IPv6reference   = "[" IPv6address "]"
 


toplabel

protected static final BitSet toplabel
BitSet for toplabel.

 toplabel      = alpha | alpha *( alphanum | "-" ) alphanum
 


domainlabel

protected static final BitSet domainlabel
BitSet for domainlabel.

 domainlabel   = alphanum | alphanum *( alphanum | "-" ) alphanum
 


hostname

protected static final BitSet hostname
BitSet for hostname.

 hostname      = *( domainlabel "." ) toplabel [ "." ]
 


host

protected static final BitSet host
BitSet for host.

 host          = hostname | IPv4address | IPv6reference
 


hostport

protected static final BitSet hostport
BitSet for hostport.

 hostport      = host [ ":" port ]
 


userinfo

protected static final BitSet userinfo
Bitset for userinfo.

 userinfo      = *( unreserved | escaped |
                    ";" | ":" | "&" | "=" | "+" | "$" | "," )
 


within_userinfo

public static final BitSet within_userinfo
BitSet for within the userinfo component like user and password.


server

protected static final BitSet server
Bitset for server.

 server        = [ [ userinfo "@" ] hostport ]
 


reg_name

protected static final BitSet reg_name
BitSet for reg_name.

 reg_name      = 1*( unreserved | escaped | "$" | "," |
                     ";" | ":" | "@" | "&" | "=" | "+" )
 


authority

protected static final BitSet authority
BitSet for authority.

 authority     = server | reg_name
 


scheme

protected static final BitSet scheme
BitSet for scheme.

 scheme        = alpha *( alpha | digit | "+" | "-" | "." )
 


rel_segment

protected static final BitSet rel_segment
BitSet for rel_segment.

 rel_segment   = 1*( unreserved | escaped |
                     ";" | "@" | "&" | "=" | "+" | "$" | "," )
 


rel_path

protected static final BitSet rel_path
BitSet for rel_path.

 rel_path      = rel_segment [ abs_path ]
 


net_path

protected static final BitSet net_path
BitSet for net_path.

 net_path      = "//" authority [ abs_path ]
 


hier_part

protected static final BitSet hier_part
BitSet for hier_part.

 hier_part     = ( net_path | abs_path ) [ "?" query ]
 


relativeURI

protected static final BitSet relativeURI
BitSet for relativeURI.

 relativeURI   = ( net_path | abs_path | rel_path ) [ "?" query ]
 


absoluteURI

protected static final BitSet absoluteURI
BitSet for absoluteURI.

 absoluteURI   = scheme ":" ( hier_part | opaque_part )
 


URI_reference

protected static final BitSet URI_reference
BitSet for URI-reference.

 URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
 


control

public static final BitSet control
BitSet for control.


space

public static final BitSet space
BitSet for space.


delims

public static final BitSet delims
BitSet for delims.


unwise

public static final BitSet unwise
BitSet for unwise.


disallowed_rel_path

public static final BitSet disallowed_rel_path
Disallowed rel_path before escaping.


disallowed_opaque_part

public static final BitSet disallowed_opaque_part
Disallowed opaque_part before escaping.


allowed_authority

public static final BitSet allowed_authority
Those characters that are allowed for the authority component.


allowed_opaque_part

public static final BitSet allowed_opaque_part
Those characters that are allowed for the opaque_part.


allowed_reg_name

public static final BitSet allowed_reg_name
Those characters that are allowed for the reg_name.


allowed_userinfo

public static final BitSet allowed_userinfo
Those characters that are allowed for the userinfo component.


allowed_within_userinfo

public static final BitSet allowed_within_userinfo
Those characters that are allowed for within the userinfo component.


allowed_IPv6reference

public static final BitSet allowed_IPv6reference
Those characters that are allowed for the IPv6reference component. The characters '[', ']' in IPv6reference should be excluded.


allowed_host

public static final BitSet allowed_host
Those characters that are allowed for the host component. The characters '[', ']' in IPv6reference should be excluded.


allowed_within_authority

public static final BitSet allowed_within_authority
Those characters that are allowed for the authority component.


allowed_abs_path

public static final BitSet allowed_abs_path
Those characters that are allowed for the abs_path.


allowed_rel_path

public static final BitSet allowed_rel_path
Those characters that are allowed for the rel_path.


allowed_within_path

public static final BitSet allowed_within_path
Those characters that are allowed within the path.


allowed_query

public static final BitSet allowed_query
Those characters that are allowed for the query component.


allowed_within_query

public static final BitSet allowed_within_query
Those characters that are allowed within the query component.


allowed_fragment

public static final BitSet allowed_fragment
Those characters that are allowed for the fragment component.


_is_hier_part

protected boolean _is_hier_part

_is_opaque_part

protected boolean _is_opaque_part

_is_net_path

protected boolean _is_net_path

_is_abs_path

protected boolean _is_abs_path

_is_rel_path

protected boolean _is_rel_path

_is_reg_name

protected boolean _is_reg_name

_is_server

protected boolean _is_server

_is_hostname

protected boolean _is_hostname

_is_IPv4address

protected boolean _is_IPv4address

_is_IPv6reference

protected boolean _is_IPv6reference
Constructor Detail

URI

protected URI()
Create an instance as an internal use


URI

public URI(char[] escaped,
           String charset)
    throws URIException,
           NullPointerException
Construct a URI as an escaped form of a character array with the given charset.

Parameters:
escaped - the URI character sequence
charset - the charset string to do escape encoding
Throws:
URIException - If the URI cannot be created.
NullPointerException - if escaped is null
See Also:
getProtocolCharset()

URI

public URI(char[] escaped)
    throws URIException,
           NullPointerException
Construct a URI as an escaped form of a character array. An URI can be placed within double-quotes or angle brackets like "http://test.com/" and <http://test.com/>

Parameters:
escaped - the URI character sequence
Throws:
URIException - If the URI cannot be created.
NullPointerException - if escaped is null
See Also:
getDefaultProtocolCharset()

URI

public URI(String original,
           Strin