Parsing of a URI specification is done according to the URI syntax described in RFC 2396, and amended by RFC 2732.
Every absolute URI consists of a scheme, followed by a colon (':'), followed by a scheme-specific part. For URIs that follow the "generic URI" syntax, the scheme-specific part begins with two slashes ("//") and may be followed by an authority segment (comprised of user information, host, and port), path segment, query segment and fragment. Note that RFC 2396 no longer specifies the use of the parameters segment and excludes the "user:password" syntax as part of the authority segment. If "user:password" appears in a URI, the entire user/password string is stored as userinfo.
For URIs that do not follow the "generic URI" syntax (e.g. mailto), the entire scheme-specific part is treated as the "path" portion of the URI.
Note that, unlike the java.net.URL class, this class does not provide any built-in network access functionality nor does it provide any scheme-specific functionality (for example, it does not know a default port for a specific scheme). Rather, it only knows the grammar and basic set of operations that can be applied to a URI.
| Modifier and Type | Class and Description |
|---|---|
| public static class | URI.MalformedURIException
MalformedURIExceptions are thrown in the process of building a URI or setting fields on a URI when an operation would result in an invalid URI specification. |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | ASCII_ALPHA_CHARACTERS
ASCII letter characters |
| private static final int | ASCII_DIGIT_CHARACTERS
ASCII digit characters |
| private static final int | ASCII_HEX_CHARACTERS
ASCII hex characters |
| private static final byte[] | |
| private String | m_fragment
If specified, stores the fragment for this URI; otherwise null |
| private String | m_host
If specified, stores the host for this URI; otherwise null |
| private String | m_path
If specified, stores the path for this URI; otherwise null |
| private int | m_port
If specified, stores the port for this URI; otherwise -1 |
| private String | m_queryString
If specified, stores the query string for this URI; otherwise null. |
| private String | m_regAuthority
If specified, stores the registry based authority for this URI; otherwise -1 |
| private String | m_scheme
Stores the scheme (usually the protocol) for this URI. |
| private String | m_userinfo
If specified, stores the userinfo for this URI; otherwise null |
| private static final int | MARK_CHARACTERS
URI punctuation mark characters: -_.!~*'() - these, combined with alphanumerics, constitute the "unreserved" characters |
| private static final int | MASK_ALPHA_NUMERIC
Mask for alpha-numeric characters |
| private static final int | MASK_PATH_CHARACTER
Mask for path characters |
| private static final int | MASK_SCHEME_CHARACTER
Mask for scheme characters |
| private static final int | MASK_UNRESERVED_MASK
Mask for unreserved characters |
| private static final int | MASK_URI_CHARACTER
Mask for URI allowable characters except for % |
| private static final int | MASK_USERINFO_CHARACTER
Mask for userinfo characters |
| private static final int | PATH_CHARACTERS
Path characters |
| private static final int | RESERVED_CHARACTERS
reserved characters ;/?:@&=+$,[] |
| private static final int | SCHEME_CHARACTERS
scheme can be composed of alphanumerics and these characters: +-. |
| pack-priv static final long | serialVersionUID
Serialization version. |
| private static final int | USERINFO_CHARACTERS
userinfo can be composed of unreserved, escaped and these characters: ;:&=+$, |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public | |
| public | URI(URI
the base URI (cannot be null if p_uriSpec is null or
empty) p_base, String the URI specification string (cannot be null or
empty if p_base is null) p_uriSpec, boolean true to permit non-absolute URIs,
false otherwise. allowNonAbsoluteURI)Construct a new URI from a base URI and a URI specification string. |
| public | |
| public | URI(String
the URI scheme (cannot be null or empty) p_scheme, String the hostname, IPv4 address or IPv6 reference for the URI p_host, String the URI path - if the path contains '?' or '#',
then the query string and/or fragment will be
set from the path; however, if the query and
fragment are specified both in the path and as
separate parameters, an exception is thrown p_path, String the URI query string (cannot be specified
if path is null) p_queryString, String the URI fragment (cannot be specified if path
is null) p_fragment)Construct a new URI that follows the generic URI syntax from its component parts. |
| public | URI(String
the URI scheme (cannot be null or empty) p_scheme, String the URI userinfo (cannot be specified if host
is null) p_userinfo, String the hostname, IPv4 address or IPv6 reference for the URI p_host, int the URI port (may be -1 for "unspecified"; cannot
be specified if host is null) p_port, String the URI path - if the path contains '?' or '#',
then the query string and/or fragment will be
set from the path; however, if the query and
fragment are specified both in the path and as
separate parameters, an exception is thrown p_path, String the URI query string (cannot be specified
if path is null) p_queryString, String the URI fragment (cannot be specified if path
is null) p_fragment)Construct a new URI that follows the generic URI syntax from its component parts. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | appendPath(String
the new segment to be added to the current path p_addToPath)Append to the end of the path of this URI. |
| public boolean | Returns: true if p_test is a URI with all values equal to this URI, false otherwisethe Object to test for equality. p_test)Overrides java. |
| public String | |
| public String | Returns: the fragment for this URI. Null is returned if there was no "#" in the URI spec, empty string if there was a "#" but no fragment following it.Get the fragment for this URI. |
| public String | |
| public String | Returns: the path for this URI possibly including the query string and fragmentif true (and query string is not null),
then a "?" followed by the query string
will be appended p_includeQueryString, boolean if true (and fragment is not null),
then a "#" followed by the fragment
will be appended p_includeFragment)Get the path for this URI (optionally with the query string and fragment). |
| public String | |
| public int | |
| public String | Returns: the query string for this URI. Null is returned if there was no "?" in the URI spec, empty string if there was a "?" but no query string following it.Get the query string for this URI. |
| public String | Returns: the registry based authority (null if not specified).Get the registry based authority for this URI. |
| public String | |
| public String | Returns: the scheme-specific part for this URIGet the scheme-specific part for this URI (everything following the scheme and the first colon). |
| public String | Returns: the userinfo for this URI (null if not specified).Get the userinfo for this URI. |
| private void | initialize(URI
the URI to copy (cannot be null) p_other)Initialize all fields of this URI from another URI. |
| private void | initialize(URI
the base URI (may be null if p_uriSpec is an absolute
URI) p_base, String the URI spec string which may be an absolute or
relative URI (can only be null/empty if p_base
is not null) p_uriSpec, boolean true to permit non-absolute URIs,
in case of relative URI, false otherwise. allowNonAbsoluteURI)Initializes this URI from a base URI and a URI specification string. |
| private void | initialize(URI
the base URI (may be null if p_uriSpec is an absolute
URI) p_base, String the URI spec string which may be an absolute or
relative URI (can only be null/empty if p_base
is not null) p_uriSpec)Initializes this URI from a base URI and a URI specification string. |
| private boolean | Returns: true if the given string matched server or registry based authoritythe URI specification (cannot be null) p_uriSpec)Initialize the authority (either server or registry based) for this URI from a URI string spec. |
| private void | initializePath(String
the URI specification (cannot be null) p_uriSpec, int the index to begin scanning from p_nStartIndex)Initialize the path for this URI from a URI string spec. |
| private void | initializeScheme(String
the URI specification (cannot be null) p_uriSpec)Initialize the scheme for this URI from a URI string spec. |
| public boolean | Returns: true if this URI represents an absolute URI, false otherwiseReturns whether this URI represents an absolute URI. |
| private static boolean | Returns: true if the char is alphabetic, false otherwiseDetermine whether a char is an alphabetic character: a-z or A-Z |
| private static boolean | Returns: true if the char is alphanumeric, false otherwiseDetermine whether a char is an alphanumeric: 0-9, a-z or A-Z |
| public static boolean | Returns: true if the scheme is conformant, false otherwiseDetermine whether a scheme conforms to the rules for a scheme name. |
| private static boolean | Returns: true if the char is betweeen '0' and '9', false otherwiseDetermine whether a char is a digit. |
| public boolean | Returns: true if this URI uses the "generic URI" syntax, false otherwiseGet the indicator as to whether this URI uses the "generic URI" syntax. |
| private static boolean | Returns: true if the char is betweeen '0' and '9', 'a' and 'f' or 'A' and 'F', false otherwiseDetermine whether a character is a hexadecimal character. |
| private static boolean | Returns: true if the char is a path character, false otherwiseDetermine whether a char is a path character. |
| private static boolean | Returns: true if the string contains any reserved charactersDetermine whether a character is a reserved character: ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '[', or ']' |
| private static boolean | Returns: true if the char is a scheme character, false otherwiseDetermine whether a char is a scheme character. |
| private static boolean | Returns: true if the char is unreserved, false otherwiseDetermine whether a char is an unreserved character. |
| private static boolean | Returns: true if the char is a URI character, false otherwiseDetermine whether a char is a URI character (reserved or unreserved, not including '%' for escaped octets). |
| private static boolean | Returns: true if the string is comprised of uric, false otherwiseDetermine whether a given string contains only URI characters (also called "uric" in RFC 2396). |
| private static boolean | Returns: true if the char is a userinfo character, false otherwiseDetermine whether a char is a userinfo character. |
| private boolean | Returns: true if the given string is a registry based authoritythe authority component of a URI authority)Determines whether the given string is a registry based authority. |
| private boolean | Returns: true if the given host, port, and userinfo compose a valid server authoritythe host component of authority host, int the port number component of authority port, String the user info component of authority userinfo)Determines whether the components host, port, and user info are valid as a server authority. |
| public static boolean | Returns: true if the string is a syntactically valid IPv4 address, IPv6 reference or hostnameDetermine whether a string is syntactically capable of representing a valid IPv4 address, IPv6 reference or the domain name of a network host. |
| public static boolean | Returns: true if the string is a syntactically valid IPv4 addressDetermines whether a string is an IPv4 address as defined by RFC 2373, and under the further constraint that it must be a 32-bit address. |
| public static boolean | Returns: true if the string is a syntactically valid IPv6 referenceDetermines whether a string is an IPv6 reference as defined by RFC 2732, where IPv6address is defined in RFC 2373. |
| private static int | Returns: the index of the next character to scan, or -1 if the string cannot match a valid IPv6 addressthe string to be scanned address, int the beginning index (inclusive) index, int the ending index (exclusive) end, int[] a counter for the number of 16-bit sections read
in the address counter)Helper method for isWellFormedIPv6Reference which scans the hex sequences of an IPv6 address. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setRegBasedAuthority(String
the registry based authority for this URI authority)Sets the registry based authority for this URI. |
| public void | |
| public void | |
| public String | Returns: the URI string specificationOverrides java. |
| ASCII_ALPHA_CHARACTERS | back to summary |
|---|---|
| private static final int ASCII_ALPHA_CHARACTERS ASCII letter characters | |
| ASCII_DIGIT_CHARACTERS | back to summary |
|---|---|
| private static final int ASCII_DIGIT_CHARACTERS ASCII digit characters | |
| ASCII_HEX_CHARACTERS | back to summary |
|---|---|
| private static final int ASCII_HEX_CHARACTERS ASCII hex characters | |
| fgLookupTable | back to summary |
|---|---|
| private static final byte[] fgLookupTable | |
| m_fragment | back to summary |
|---|---|
| private String m_fragment If specified, stores the fragment for this URI; otherwise null | |
| m_host | back to summary |
|---|---|
| private String m_host If specified, stores the host for this URI; otherwise null | |
| m_path | back to summary |
|---|---|
| private String m_path If specified, stores the path for this URI; otherwise null | |
| m_port | back to summary |
|---|---|
| private int m_port If specified, stores the port for this URI; otherwise -1 | |
| m_queryString | back to summary |
|---|---|
| private String m_queryString If specified, stores the query string for this URI; otherwise null. | |
| m_regAuthority | back to summary |
|---|---|
| private String m_regAuthority If specified, stores the registry based authority for this URI; otherwise -1 | |
| m_scheme | back to summary |
|---|---|
| private String m_scheme Stores the scheme (usually the protocol) for this URI. | |
| m_userinfo | back to summary |
|---|---|
| private String m_userinfo If specified, stores the userinfo for this URI; otherwise null | |
| MARK_CHARACTERS | back to summary |
|---|---|
| private static final int MARK_CHARACTERS URI punctuation mark characters: -_.!~*'() - these, combined with alphanumerics, constitute the "unreserved" characters | |
| MASK_ALPHA_NUMERIC | back to summary |
|---|---|
| private static final int MASK_ALPHA_NUMERIC Mask for alpha-numeric characters | |
| MASK_PATH_CHARACTER | back to summary |
|---|---|
| private static final int MASK_PATH_CHARACTER Mask for path characters | |
| MASK_SCHEME_CHARACTER | back to summary |
|---|---|
| private static final int MASK_SCHEME_CHARACTER Mask for scheme characters | |
| MASK_UNRESERVED_MASK | back to summary |
|---|---|
| private static final int MASK_UNRESERVED_MASK Mask for unreserved characters | |
| MASK_URI_CHARACTER | back to summary |
|---|---|
| private static final int MASK_URI_CHARACTER Mask for URI allowable characters except for % | |
| MASK_USERINFO_CHARACTER | back to summary |
|---|---|
| private static final int MASK_USERINFO_CHARACTER Mask for userinfo characters | |
| PATH_CHARACTERS | back to summary |
|---|---|
| private static final int PATH_CHARACTERS Path characters | |
| RESERVED_CHARACTERS | back to summary |
|---|---|
| private static final int RESERVED_CHARACTERS reserved characters ;/?:@&=+$,[] | |
| SCHEME_CHARACTERS | back to summary |
|---|---|
| private static final int SCHEME_CHARACTERS scheme can be composed of alphanumerics and these characters: +-. | |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID Serialization version. | |
| USERINFO_CHARACTERS | back to summary |
|---|---|
| private static final int USERINFO_CHARACTERS userinfo can be composed of unreserved, escaped and these characters: ;:&=+$, | |
| URI | back to summary |
|---|---|
| public URI() Construct a new and uninitialized URI. | |
| URI | back to summary |
|---|---|
| public URI(URI p_other) Construct a new URI from another URI. All fields for this URI are set equal to the fields of the URI passed in.
| |
| URI | back to summary |
|---|---|
| public URI(String p_uriSpec) throws MalformedURIException Construct a new URI from a URI specification string. If the specification follows the "generic URI" syntax, (two slashes following the first colon), the specification will be parsed accordingly - setting the scheme, userinfo, host,port, path, query string and fragment fields as necessary. If the specification does not follow the "generic URI" syntax, the specification is parsed into a scheme and scheme-specific part (stored as the path) only.
| |
| URI | back to summary |
|---|---|
| public URI(String p_uriSpec, boolean allowNonAbsoluteURI) throws MalformedURIException Construct a new URI from a URI specification string. If the specification follows the "generic URI" syntax, (two slashes following the first colon), the specification will be parsed accordingly - setting the scheme, userinfo, host,port, path, query string and fragment fields as necessary. If the specification does not follow the "generic URI" syntax, the specification is parsed into a scheme and scheme-specific part (stored as the path) only. Construct a relative URI if boolean is assigned to "true" and p_uriSpec is not valid absolute URI, instead of throwing an exception.
| |
| URI | back to summary |
|---|---|
| public URI(URI p_base, String p_uriSpec) throws MalformedURIException Construct a new URI from a base URI and a URI specification string. The URI specification string may be a relative URI.
| |
| URI | back to summary |
|---|---|
| public URI(URI p_base, String p_uriSpec, boolean allowNonAbsoluteURI) throws MalformedURIException Construct a new URI from a base URI and a URI specification string. The URI specification string may be a relative URI. Construct a relative URI if boolean is assigned to "true" and p_uriSpec is not valid absolute URI and p_base is null instead of throwing an exception.
| |
| URI | back to summary |
|---|---|
| public URI(String p_scheme, String p_schemeSpecificPart) throws MalformedURIException Construct a new URI that does not follow the generic URI syntax. Only the scheme and scheme-specific part (stored as the path) are initialized.
| |
| URI | back to summary |
|---|---|
| public URI(String p_scheme, String p_host, String p_path, String p_queryString, String p_fragment) throws MalformedURIException Construct a new URI that follows the generic URI syntax from its component parts. Each component is validated for syntax and some basic semantic checks are performed as well. See the individual setter methods for specifics.
| |
| URI | back to summary |
|---|---|
| public URI(String p_scheme, String p_userinfo, String p_host, int p_port, String p_path, String p_queryString, String p_fragment) throws MalformedURIException Construct a new URI that follows the generic URI syntax from its component parts. Each component is validated for syntax and some basic semantic checks are performed as well. See the individual setter methods for specifics.
| |
| absolutize | back to summary |
|---|---|
| public void absolutize(URI p_base) Absolutize URI with given base URI.
| |
| appendPath | back to summary |
|---|---|
| public void appendPath(String p_addToPath) throws MalformedURIException Append to the end of the path of this URI. If the current path does not end in a slash and the path to be appended does not begin with a slash, a slash will be appended to the current path before the new segment is added. Also, if the current path ends in a slash and the new segment begins with a slash, the extra slash will be removed before the new segment is appended.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object p_test) Overrides java. Determines if the passed-in Object is equivalent to this URI.
| |
| getAuthority | back to summary |
|---|---|
| public String getAuthority() Get the authority for this URI.
| |
| getFragment | back to summary |
|---|---|
| public String getFragment() Get the fragment for this URI.
| |
| getHost | back to summary |
|---|---|
| public String getHost() Get the host for this URI.
| |
| getPath | back to summary |
|---|---|
| public String getPath(boolean p_includeQueryString, boolean p_includeFragment) Get the path for this URI (optionally with the query string and fragment).
| |
| getPath | back to summary |
|---|---|
| public String getPath() Get the path for this URI. Note that the value returned is the path only and does not include the query string or fragment.
| |
| getPort | back to summary |
|---|---|
| public int getPort() Get the port for this URI.
| |
| getQueryString | back to summary |
|---|---|
| public String getQueryString() Get the query string for this URI.
| |
| getRegBasedAuthority | back to summary |
|---|---|
| public String getRegBasedAuthority() Get the registry based authority for this URI.
| |
| getScheme | back to summary |
|---|---|
| public String getScheme() Get the scheme for this URI.
| |
| getSchemeSpecificPart | back to summary |
|---|---|
| public String getSchemeSpecificPart() Get the scheme-specific part for this URI (everything following the scheme and the first colon). See RFC 2396 Section 5.2 for spec.
| |
| getUserinfo | back to summary |
|---|---|
| public String getUserinfo() Get the userinfo for this URI.
| |
| initialize | back to summary |
|---|---|
| private void initialize(URI p_other) Initialize all fields of this URI from another URI.
| |
| initialize | back to summary |
|---|---|
| private void initialize(URI p_base, String p_uriSpec, boolean allowNonAbsoluteURI) throws MalformedURIException Initializes this URI from a base URI and a URI specification string. See RFC 2396 Section 4 and Appendix B for specifications on parsing the URI and Section 5 for specifications on resolving relative URIs and relative paths.
| |
| initialize | back to summary |
|---|---|
| private void initialize(URI p_base, String p_uriSpec) throws MalformedURIException Initializes this URI from a base URI and a URI specification string. See RFC 2396 Section 4 and Appendix B for specifications on parsing the URI and Section 5 for specifications on resolving relative URIs and relative paths.
| |
| initializeAuthority | back to summary |
|---|---|
| private boolean initializeAuthority(String p_uriSpec) Initialize the authority (either server or registry based) for this URI from a URI string spec.
| |
| initializePath | back to summary |
|---|---|
| private void initializePath(String p_uriSpec, int p_nStartIndex) throws MalformedURIException Initialize the path for this URI from a URI string spec.
| |
| initializeScheme | back to summary |
|---|---|
| private void initializeScheme(String p_uriSpec) throws MalformedURIException Initialize the scheme for this URI from a URI string spec.
| |
| isAbsoluteURI | back to summary |
|---|---|
| public boolean isAbsoluteURI() Returns whether this URI represents an absolute URI.
| |
| isAlpha | back to summary |
|---|---|
| private static boolean isAlpha(char p_char) Determine whether a char is an alphabetic character: a-z or A-Z
| |
| isAlphanum | back to summary |
|---|---|
| private static boolean isAlphanum(char p_char) Determine whether a char is an alphanumeric: 0-9, a-z or A-Z
| |
| isConformantSchemeName | back to summary |
|---|---|
| public static boolean isConformantSchemeName(String p_scheme) Determine whether a scheme conforms to the rules for a scheme name. A scheme is conformant if it starts with an alphanumeric, and contains only alphanumerics, '+','-' and '.'.
| |
| isDigit | back to summary |
|---|---|
| private static boolean isDigit(char p_char) Determine whether a char is a digit.
| |
| isGenericURI | back to summary |
|---|---|
| public boolean isGenericURI() Get the indicator as to whether this URI uses the "generic URI" syntax.
| |
| isHex | back to summary |
|---|---|
| private static boolean isHex(char p_char) Determine whether a character is a hexadecimal character.
| |
| isPathCharacter | back to summary |
|---|---|
| private static boolean isPathCharacter(char p_char) Determine whether a char is a path character.
| |
| isReservedCharacter | back to summary |
|---|---|
| private static boolean isReservedCharacter(char p_char) Determine whether a character is a reserved character: ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '[', or ']'
| |
| isSchemeCharacter | back to summary |
|---|---|
| private static boolean isSchemeCharacter(char p_char) Determine whether a char is a scheme character.
| |
| isUnreservedCharacter | back to summary |
|---|---|
| private static boolean isUnreservedCharacter(char p_char) Determine whether a char is an unreserved character.
| |
| isURICharacter | back to summary |
|---|---|
| private static boolean isURICharacter(char p_char) Determine whether a char is a URI character (reserved or unreserved, not including '%' for escaped octets).
| |
| isURIString | back to summary |
|---|---|
| private static boolean isURIString(String p_uric) Determine whether a given string contains only URI characters (also called "uric" in RFC 2396). uric consist of all reserved characters, unreserved characters and escaped characters.
| |
| isUserinfoCharacter | back to summary |
|---|---|
| private static boolean isUserinfoCharacter(char p_char) Determine whether a char is a userinfo character.
| |
| isValidRegistryBasedAuthority | back to summary |
|---|---|
| private boolean isValidRegistryBasedAuthority(String authority) Determines whether the given string is a registry based authority.
| |
| isValidServerBasedAuthority | back to summary |
|---|---|
| private boolean isValidServerBasedAuthority(String host, int port, String userinfo) Determines whether the components host, port, and user info are valid as a server authority. | |
| isWellFormedAddress | back to summary |
|---|---|
| public static boolean isWellFormedAddress(String address) Determine whether a string is syntactically capable of representing a valid IPv4 address, IPv6 reference or the domain name of a network host. A valid IPv4 address consists of four decimal digit groups separated by a '.'. Each group must consist of one to three digits. See RFC 2732 Section 3, and RFC 2373 Section 2.2, for the definition of IPv6 references. A hostname consists of domain labels (each of which must begin and end with an alphanumeric but may contain '-') separated & by a '.'. See RFC 2396 Section 3.2.2.
| |
| isWellFormedIPv4Address | back to summary |
|---|---|
| public static boolean isWellFormedIPv4Address(String address) Determines whether a string is an IPv4 address as defined by RFC 2373, and under the further constraint that it must be a 32-bit address. Though not expressed in the grammar, in order to satisfy the 32-bit address constraint, each segment of the address cannot be greater than 255 (8 bits of information).
| |
| isWellFormedIPv6Reference | back to summary |
|---|---|
| public static boolean isWellFormedIPv6Reference(String address) Determines whether a string is an IPv6 reference as defined by RFC 2732, where IPv6address is defined in RFC 2373. The IPv6 address is parsed according to Section 2.2 of RFC 2373, with the additional constraint that the address be composed of 128 bits of information.
Note The BNF expressed in RFC 2373 Appendix B does not accurately describe section 2.2, and was in fact removed from RFC 3513, the successor of RFC 2373.
| |
| scanHexSequence | back to summary |
|---|---|
| private static int scanHexSequence(String address, int index, int end, int[] counter) Helper method for isWellFormedIPv6Reference which scans the hex sequences of an IPv6 address. It returns the index of the next character to scan in the address, or -1 if the string cannot match a valid IPv6 address.
| |
| setFragment | back to summary |
|---|---|
| public void setFragment(String p_fragment) throws MalformedURIException Set the fragment for this URI. A non-null value is valid only if this is a URI conforming to the generic URI syntax and the path value is not null.
| |
| setHost | back to summary |
|---|---|
| public void setHost(String p_host) throws MalformedURIException Set the host for this URI. If null is passed in, the userinfo field is also set to null and the port is set to -1. Note This method overwrites registry based authority if it previously existed in this URI.
| |
| setPath | back to summary |
|---|---|
| public void setPath(String p_path) throws MalformedURIException Set the path for this URI. If the supplied path is null, then the query string and fragment are set to null as well. If the supplied path includes a query string and/or fragment, these fields will be parsed and set as well. Note that, for URIs following the "generic URI" syntax, the path specified should start with a slash. For URIs that do not follow the generic URI syntax, this method sets the scheme-specific part.
| |
| setPort | back to summary |
|---|---|
| public void setPort(int p_port) throws MalformedURIException Set the port for this URI. -1 is used to indicate that the port is not specified, otherwise valid port numbers are between 0 and 65535. If a valid port number is passed in and the host field is null, an exception is thrown.
| |
| setQueryString | back to summary |
|---|---|
| public void setQueryString(String p_queryString) throws MalformedURIException Set the query string for this URI. A non-null value is valid only if this is an URI conforming to the generic URI syntax and the path value is not null.
| |
| setRegBasedAuthority | back to summary |
|---|---|
| public void setRegBasedAuthority(String authority) throws MalformedURIException Sets the registry based authority for this URI. Note This method overwrites server based authority if it previously existed in this URI.
| |
| setScheme | back to summary |
|---|---|
| public void setScheme(String p_scheme) throws MalformedURIException Set the scheme for this URI. The scheme is converted to lowercase before it is set.
| |
| setUserinfo | back to summary |
|---|---|
| public void setUserinfo(String p_userinfo) throws MalformedURIException Set the userinfo for this URI. If a non-null value is passed in and the host value is null, then an exception is thrown.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Get the URI as a string specification. See RFC 2396 Section 5.2.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final long | serialVersionUID
Serialization version.
|
| Access | Constructor and Description |
|---|---|
| public | |
| public | MalformedURIException(String
the detail message. p_msg)Constructs a |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID Hides java. Serialization version. | |
| MalformedURIException | back to summary |
|---|---|
| public MalformedURIException() Constructs a | |
| MalformedURIException | back to summary |
|---|---|
| public MalformedURIException(String p_msg) Constructs a
| |