APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.org.apache.xml.internal.utils

public Class URI

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.IOException, .Serializable, com.sun.org.apache.xml.internal.res.XMLErrorResources, .XMLMessages, java.util.Objects

A class to represent a Uniform Resource Identifier (URI). This class is designed to handle the parsing of URIs and provide access to the various components (scheme, host, port, userinfo, path, query string and fragment) that may constitute a URI.

Parsing of a URI specification is done according to the URI syntax described in RFC 2396 . Every 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.

Nested and Inner Type Summary

Modifier and TypeClass 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.

Field Summary

Modifier and TypeField and Description
private static boolean
DEBUG

Indicate whether in DEBUG mode

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_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 String
MARK_CHARACTERS

URI punctuation mark characters - these, combined with alphanumerics, constitute the "unreserved" characters

private static final String
RESERVED_CHARACTERS

reserved characters

private static final String
SCHEME_CHARACTERS

scheme can be composed of alphanumerics and these characters

private static final long
private static final String
USERINFO_CHARACTERS

userinfo can be composed of unreserved, escaped and these characters

Constructor Summary

AccessConstructor and Description
public
URI()

Construct a new and uninitialized URI.

public
URI(URI
the URI to copy (cannot be null)
p_other
)

Construct a new URI from another URI.

public
URI(String
the URI specification string (cannot be null or empty)
p_uriSpec
)

Construct a new URI from a URI specification string.

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
)

Construct a new URI from a base URI and a URI specification string.

public
URI(String
the URI scheme (cannot be null or empty)
p_scheme
,
String
the scheme-specific part (cannot be null or empty)
p_schemeSpecificPart
)

Construct a new URI that does not follow the generic URI syntax.

public
URI(String
the URI scheme (cannot be null or empty)
p_scheme
,
String
the hostname or IPv4 address 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 or IPv4 address 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.

Method Summary

Modifier and TypeMethod and Description
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 otherwise
equals
(Object
the Object to test for equality.
p_test
)

Overrides java.lang.Object.equals.

Determines if the passed-in Object is equivalent to this URI.

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.
getFragment
()

Get the fragment for this URI.

public String

Returns:

the host for this URI (null if not specified).
getHost
()

Get the host for this URI.

public String

Returns:

the path for this URI possibly including the query string and fragment
getPath
(boolean
if 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

Returns:

the path for this URI.
getPath
()

Get the path for this URI.

public int

Returns:

the port for this URI (-1 if not specified).
getPort
()

Get the port for this URI.

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.
getQueryString
()

Get the query string for this URI.

public String

Returns:

the scheme for this URI
getScheme
()

Get the scheme for this URI.

public String

Returns:

the scheme-specific part for this URI
getSchemeSpecificPart
()

Get 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).
getUserinfo
()

Get the userinfo for this URI.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

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
)

Initializes this URI from a base URI and a URI specification string.

private void
initializeAuthority(String
the URI specification (cannot be null)
p_uriSpec
)

Initialize the authority (userinfo, host and port) for this URI from a URI string spec.

private void
initializePath(String
the URI specification (cannot be null)
p_uriSpec
)

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.

private static boolean

Returns:

true if the char is alphabetic, false otherwise
isAlpha
(char
the character to check
p_char
)

Determine whether a char is an alphabetic character: a-z or A-Z

private static boolean

Returns:

true if the char is alphanumeric, false otherwise
isAlphanum
(char
the character to check
p_char
)

Determine whether a char is an alphanumeric: 0-9, a-z or A-Z

public static boolean

Returns:

true if the scheme is conformant, false otherwise
isConformantSchemeName
(String
The sheme name to check
p_scheme
)

Determine 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 otherwise
isDigit
(char
the character to check
p_char
)

Determine whether a char is a digit.

public boolean

Returns:

true if this URI uses the "generic URI" syntax, false otherwise
isGenericURI
()

Get 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 otherwise
isHex
(char
the character to check
p_char
)

Determine whether a character is a hexadecimal character.

private static boolean

Returns:

true if the string contains any reserved characters
isReservedCharacter
(char
the character to check
p_char
)

Determine whether a character is a reserved character: ';', '/', '?', ':', '@', '&', '=', '+', '$' or ','

private static boolean

Returns:

true if the char is unreserved, false otherwise
isUnreservedCharacter
(char
the character to check
p_char
)

Determine whether a char is an unreserved character.

private static boolean

Returns:

true if the string is comprised of uric, false otherwise
isURIString
(String
URI string
p_uric
)

Determine whether a given string contains only URI characters (also called "uric" in RFC 2396).

public static boolean

Returns:

true if the string is a syntactically valid IPv4 address or hostname
isWellFormedAddress
(String
The address string to check
p_address
)

Determine whether a string is syntactically capable of representing a valid IPv4 address or the domain name of a network host.

public void
setFragment(String
the fragment for this URI
p_fragment
)

Set the fragment for this URI.

public void
setHost(String
the host for this URI
p_host
)

Set the host for this URI.

public void
setPath(String
the path for this URI (may be null)
p_path
)

Set the path for this URI.

public void
setPort(int
the port number for this URI
p_port
)

Set the port for this URI.

public void
setQueryString(String
the query string for this URI
p_queryString
)

Set the query string for this URI.

public void
setScheme(String
the scheme for this URI (cannot be null)
p_scheme
)

Set the scheme for this URI.

public void
setUserinfo(String
the userinfo for this URI
p_userinfo
)

Set the userinfo for this URI.

public String

Returns:

the URI string specification
toString
()

Overrides java.lang.Object.toString.

Get the URI as a string specification.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

DEBUGback to summary
private static boolean DEBUG

Indicate whether in DEBUG mode

m_fragmentback to summary
private String m_fragment

If specified, stores the fragment for this URI; otherwise null.

m_hostback to summary
private String m_host

If specified, stores the host for this URI; otherwise null.

m_pathback to summary
private String m_path

If specified, stores the path for this URI; otherwise null.

m_portback to summary
private int m_port

If specified, stores the port for this URI; otherwise -1.

m_queryStringback to summary
private String m_queryString

If specified, stores the query string for this URI; otherwise null.

m_schemeback to summary
private String m_scheme

Stores the scheme (usually the protocol) for this URI.

m_userinfoback to summary
private String m_userinfo

If specified, stores the userinfo for this URI; otherwise null.

MARK_CHARACTERSback to summary
private static final String MARK_CHARACTERS

URI punctuation mark characters - these, combined with alphanumerics, constitute the "unreserved" characters

RESERVED_CHARACTERSback to summary
private static final String RESERVED_CHARACTERS

reserved characters

SCHEME_CHARACTERSback to summary
private static final String SCHEME_CHARACTERS

scheme can be composed of alphanumerics and these characters

serialVersionUIDback to summary
private static final long serialVersionUID
USERINFO_CHARACTERSback to summary
private static final String USERINFO_CHARACTERS

userinfo can be composed of unreserved, escaped and these characters

Constructor Detail

URIback to summary
public URI()

Construct a new and uninitialized URI.

URIback 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.

Parameters
p_other:URI

the URI to copy (cannot be null)

URIback 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.

Parameters
p_uriSpec:String

the URI specification string (cannot be null or empty)

Exceptions
MalformedURIException:
if p_uriSpec violates any syntax rules
URIback 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.

Parameters
p_base:URI

the base URI (cannot be null if p_uriSpec is null or empty)

p_uriSpec:String

the URI specification string (cannot be null or empty if p_base is null)

Exceptions
MalformedURIException:
if p_uriSpec violates any syntax rules
URIback 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.

Parameters
p_scheme:String

the URI scheme (cannot be null or empty)

p_schemeSpecificPart:String

the scheme-specific part (cannot be null or empty)

Exceptions
MalformedURIException:
if p_scheme violates any syntax rules
URIback 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.

Parameters
p_scheme:String

the URI scheme (cannot be null or empty)

p_host:String

the hostname or IPv4 address for the URI

p_path: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_queryString:String

the URI query string (cannot be specified if path is null)

p_fragment:String

the URI fragment (cannot be specified if path is null)

Exceptions
MalformedURIException:
if any of the parameters violates syntax rules or semantic rules
URIback 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.

Parameters
p_scheme:String

the URI scheme (cannot be null or empty)

p_userinfo:String

the URI userinfo (cannot be specified if host is null)

p_host:String

the hostname or IPv4 address for the URI

p_port:int

the URI port (may be -1 for "unspecified"; cannot be specified if host is null)

p_path: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_queryString:String

the URI query string (cannot be specified if path is null)

p_fragment:String

the URI fragment (cannot be specified if path is null)

Exceptions
MalformedURIException:
if any of the parameters violates syntax rules or semantic rules

Method Detail

appendPathback 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.

Parameters
p_addToPath:String

the new segment to be added to the current path

Exceptions
MalformedURIException:
if p_addToPath contains syntax errors
equalsback to summary
public boolean equals(Object p_test)

Overrides java.lang.Object.equals.

Determines if the passed-in Object is equivalent to this URI.

Parameters
p_test:Object

the Object to test for equality.

Returns:boolean

true if p_test is a URI with all values equal to this URI, false otherwise

Annotations
@Override
getFragmentback to summary
public String getFragment()

Get the fragment for this URI.

Returns:String

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.

getHostback to summary
public String getHost()

Get the host for this URI.

Returns:String

the host for this URI (null if not specified).

getPathback to summary
public String getPath(boolean p_includeQueryString, boolean p_includeFragment)

Get the path for this URI (optionally with the query string and fragment).

Parameters
p_includeQueryString:boolean

if true (and query string is not null), then a "?" followed by the query string will be appended

p_includeFragment:boolean

if true (and fragment is not null), then a "#" followed by the fragment will be appended

Returns:String

the path for this URI possibly including the query string and fragment

getPathback 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.

Returns:String

the path for this URI.

getPortback to summary
public int getPort()

Get the port for this URI.

Returns:int

the port for this URI (-1 if not specified).

getQueryStringback to summary
public String getQueryString()

Get the query string for this URI.

Returns:String

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.

getSchemeback to summary
public String getScheme()

Get the scheme for this URI.

Returns:String

the scheme for this URI

getSchemeSpecificPartback 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.

Returns:String

the scheme-specific part for this URI

getUserinfoback to summary
public String getUserinfo()

Get the userinfo for this URI.

Returns:String

the userinfo for this URI (null if not specified).

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
initializeback to summary
private void initialize(URI p_other)

Initialize all fields of this URI from another URI.

Parameters
p_other:URI

the URI to copy (cannot be null)

initializeback 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.

Parameters
p_base:URI

the base URI (may be null if p_uriSpec is an absolute URI)

p_uriSpec:String

the URI spec string which may be an absolute or relative URI (can only be null/empty if p_base is not null)

Exceptions
MalformedURIException:
if p_base is null and p_uriSpec is not an absolute URI or if p_uriSpec violates syntax rules
initializeAuthorityback to summary
private void initializeAuthority(String p_uriSpec) throws MalformedURIException

Initialize the authority (userinfo, host and port) for this URI from a URI string spec.

Parameters
p_uriSpec:String

the URI specification (cannot be null)

Exceptions
MalformedURIException:
if p_uriSpec violates syntax rules
initializePathback to summary
private void initializePath(String p_uriSpec) throws MalformedURIException

Initialize the path for this URI from a URI string spec.

Parameters
p_uriSpec:String

the URI specification (cannot be null)

Exceptions
MalformedURIException:
if p_uriSpec violates syntax rules
initializeSchemeback to summary
private void initializeScheme(String p_uriSpec) throws MalformedURIException

Initialize the scheme for this URI from a URI string spec.

Parameters
p_uriSpec:String

the URI specification (cannot be null)

Exceptions
MalformedURIException:
if URI does not have a conformant scheme
isAlphaback to summary
private static boolean isAlpha(char p_char)

Determine whether a char is an alphabetic character: a-z or A-Z

Parameters
p_char:char

the character to check

Returns:boolean

true if the char is alphabetic, false otherwise

isAlphanumback to summary
private static boolean isAlphanum(char p_char)

Determine whether a char is an alphanumeric: 0-9, a-z or A-Z

Parameters
p_char:char

the character to check

Returns:boolean

true if the char is alphanumeric, false otherwise

isConformantSchemeNameback 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 '.'.

Parameters
p_scheme:String

The sheme name to check

Returns:boolean

true if the scheme is conformant, false otherwise

isDigitback to summary
private static boolean isDigit(char p_char)

Determine whether a char is a digit.

Parameters
p_char:char

the character to check

Returns:boolean

true if the char is betweeen '0' and '9', false otherwise

isGenericURIback to summary
public boolean isGenericURI()

Get the indicator as to whether this URI uses the "generic URI" syntax.

Returns:boolean

true if this URI uses the "generic URI" syntax, false otherwise

isHexback to summary
private static boolean isHex(char p_char)

Determine whether a character is a hexadecimal character.

Parameters
p_char:char

the character to check

Returns:boolean

true if the char is betweeen '0' and '9', 'a' and 'f' or 'A' and 'F', false otherwise

isReservedCharacterback to summary
private static boolean isReservedCharacter(char p_char)

Determine whether a character is a reserved character: ';', '/', '?', ':', '@', '&', '=', '+', '$' or ','

Parameters
p_char:char

the character to check

Returns:boolean

true if the string contains any reserved characters

isUnreservedCharacterback to summary
private static boolean isUnreservedCharacter(char p_char)

Determine whether a char is an unreserved character.

Parameters
p_char:char

the character to check

Returns:boolean

true if the char is unreserved, false otherwise

isURIStringback 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.

Parameters
p_uric:String

URI string

Returns:boolean

true if the string is comprised of uric, false otherwise

isWellFormedAddressback to summary
public static boolean isWellFormedAddress(String p_address)

Determine whether a string is syntactically capable of representing a valid IPv4 address or the domain name of a network host. A valid IPv4 address consists of four decimal digit groups separated by a '.'. 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.

Parameters
p_address:String

The address string to check

Returns:boolean

true if the string is a syntactically valid IPv4 address or hostname

setFragmentback 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.

Parameters
p_fragment:String

the fragment for this URI

Exceptions
MalformedURIException:
if p_fragment is not null and this URI does not conform to the generic URI syntax or if the path is null
setHostback 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.

Parameters
p_host:String

the host for this URI

Exceptions
MalformedURIException:
if p_host is not a valid IP address or DNS hostname.
setPathback 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.

Parameters
p_path:String

the path for this URI (may be null)

Exceptions
MalformedURIException:
if p_path contains invalid characters
setPortback 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.

Parameters
p_port:int

the port number for this URI

Exceptions
MalformedURIException:
if p_port is not -1 and not a valid port number
setQueryStringback 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.

Parameters
p_queryString:String

the query string for this URI

Exceptions
MalformedURIException:
if p_queryString is not null and this URI does not conform to the generic URI syntax or if the path is null
setSchemeback 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.

Parameters
p_scheme:String

the scheme for this URI (cannot be null)

Exceptions
MalformedURIException:
if p_scheme is not a conformant scheme name
setUserinfoback 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.

Parameters
p_userinfo:String

the userinfo for this URI

Exceptions
MalformedURIException:
if p_userinfo contains invalid characters
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Get the URI as a string specification. See RFC 2396 Section 5.2.

Returns:String

the URI string specification

Annotations
@Override
com.sun.org.apache.xml.internal.utils back to summary

public Class URI.MalformedURIException

extends IOException
Class Inheritance

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.

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
MalformedURIException()

Constructs a MalformedURIException with no specified detail message.

public
MalformedURIException(String
the detail message.
p_msg
)

Constructs a MalformedURIException with the specified detail message.

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.io.IOException.serialVersionUID.

Constructor Detail

MalformedURIExceptionback to summary
public MalformedURIException()

Constructs a MalformedURIException with no specified detail message.

MalformedURIExceptionback to summary
public MalformedURIException(String p_msg)

Constructs a MalformedURIException with the specified detail message.

Parameters
p_msg:String

the detail message.