java.lang.Object | |
↳ | java.net.URI |
This class represents an instance of a URI as defined by RFC 2396.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new URI instance according to the given string
uri . | |||||||||||
Creates a new URI instance using the given arguments.
| |||||||||||
Creates a new URI instance using the given arguments.
| |||||||||||
Creates a new URI instance using the given arguments.
| |||||||||||
Creates a new URI instance using the given arguments.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Compares this URI with the given argument
uri . | |||||||||||
Returns the URI formed by parsing
uri . | |||||||||||
Compares this URI instance with the given argument
o and
determines if both are equal. | |||||||||||
Gets the decoded authority part of this URI.
| |||||||||||
Gets the decoded fragment part of this URI.
| |||||||||||
Gets the host part of this URI.
| |||||||||||
Gets the decoded path part of this URI.
| |||||||||||
Gets the port number of this URI.
| |||||||||||
Gets the decoded query part of this URI.
| |||||||||||
Gets the authority part of this URI in raw form.
| |||||||||||
Gets the fragment part of this URI in raw form.
| |||||||||||
Gets the path part of this URI in raw form.
| |||||||||||
Gets the query part of this URI in raw form.
| |||||||||||
Gets the scheme-specific part of this URI in raw form.
| |||||||||||
Gets the user-info part of this URI in raw form.
| |||||||||||
Gets the scheme part of this URI.
| |||||||||||
Gets the decoded scheme-specific part of this URI.
| |||||||||||
Gets the decoded user-info part of this URI.
| |||||||||||
Gets the hashcode value of this URI instance.
| |||||||||||
Indicates whether this URI is absolute, which means that a scheme part is
defined in this URI.
| |||||||||||
Indicates whether this URI is opaque or not.
| |||||||||||
Normalizes the path part of this URI.
| |||||||||||
Tries to parse the authority component of this URI to divide it into the
host, port, and user-info.
| |||||||||||
Makes the given URI
relative to a relative URI against the URI
represented by this instance. | |||||||||||
Creates a new URI instance by parsing the given string
relative
and resolves the created URI against the URI represented by this
instance. | |||||||||||
Resolves the given URI
relative against the URI represented by
this instance. | |||||||||||
Returns the textual string representation of this URI instance using the
US-ASCII encoding.
| |||||||||||
Returns the textual string representation of this URI instance.
| |||||||||||
Converts this URI instance to a URL.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.lang.Comparable
|
Creates a new URI instance according to the given string uri
.
uri | the textual URI representation to be parsed into a URI object. |
---|
URISyntaxException | if the given string uri doesn't fit to the
specification RFC2396 or could not be parsed correctly.
|
---|
Creates a new URI instance using the given arguments. This constructor first creates a temporary URI string from the given components. This string will be parsed later on to create the URI instance.
[scheme:]scheme-specific-part[#fragment]
scheme | the scheme part of the URI. |
---|---|
ssp | the scheme-specific-part of the URI. |
frag | the fragment part of the URI. |
URISyntaxException | if the temporary created string doesn't fit to the specification RFC2396 or could not be parsed correctly. |
---|
Creates a new URI instance using the given arguments. This constructor first creates a temporary URI string from the given components. This string will be parsed later on to create the URI instance.
[scheme:][user-info@]host[:port][path][?query][#fragment]
scheme | the scheme part of the URI. |
---|---|
userInfo | the user information of the URI for authentication and authorization. |
host | the host name of the URI. |
port | the port number of the URI. |
path | the path to the resource on the host. |
query | the query part of the URI to specify parameters for the resource. |
fragment | the fragment part of the URI. |
URISyntaxException | if the temporary created string doesn't fit to the specification RFC2396 or could not be parsed correctly. |
---|
Creates a new URI instance using the given arguments. This constructor first creates a temporary URI string from the given components. This string will be parsed later on to create the URI instance.
[scheme:]host[path][#fragment]
scheme | the scheme part of the URI. |
---|---|
host | the host name of the URI. |
path | the path to the resource on the host. |
fragment | the fragment part of the URI. |
URISyntaxException | if the temporary created string doesn't fit to the specification RFC2396 or could not be parsed correctly. |
---|
Creates a new URI instance using the given arguments. This constructor first creates a temporary URI string from the given components. This string will be parsed later on to create the URI instance.
[scheme:][//authority][path][?query][#fragment]
scheme | the scheme part of the URI. |
---|---|
authority | the authority part of the URI. |
path | the path to the resource on the host. |
query | the query part of the URI to specify parameters for the resource. |
fragment | the fragment part of the URI. |
URISyntaxException | if the temporary created string doesn't fit to the specification RFC2396 or could not be parsed correctly. |
---|
Compares this URI with the given argument uri
. This method will
return a negative value if this URI instance is less than the given
argument and a positive value if this URI instance is greater than the
given argument. The return value 0
indicates that the two
instances represent the same URI. To define the order the single parts of
the URI are compared with each other. String components will be ordered
in the natural case-sensitive way. A hierarchical URI is less than an
opaque URI and if one part is null
the URI with the undefined
part is less than the other one.
uri | the URI this instance has to compare with. |
---|
Returns the URI formed by parsing uri
. This method behaves
identically to the string constructor but throws a different exception
on failure. The constructor fails with a checked URISyntaxException
; this method fails with an unchecked IllegalArgumentException
.
Compares this URI instance with the given argument o
and
determines if both are equal. Two URI instances are equal if all single
parts are identical in their meaning.
o | the URI this instance has to be compared with. |
---|
true
if both URI instances point to the same resource,
false
otherwise.
Gets the decoded authority part of this URI.
null
if undefined.
Gets the decoded fragment part of this URI.
null
if undefined.
Gets the host part of this URI.
null
if undefined.
Gets the decoded path part of this URI.
null
if undefined.
Gets the port number of this URI.
-1
if undefined.
Gets the decoded query part of this URI.
null
if undefined.
Gets the authority part of this URI in raw form.
null
if undefined.
Gets the fragment part of this URI in raw form.
null
if undefined.
Gets the path part of this URI in raw form.
null
if undefined.
Gets the query part of this URI in raw form.
null
if undefined.
Gets the scheme-specific part of this URI in raw form.
null
if undefined.
Gets the user-info part of this URI in raw form.
null
if undefined.
Gets the scheme part of this URI.
null
if undefined.
Gets the decoded scheme-specific part of this URI.
null
if undefined.
Gets the decoded user-info part of this URI.
null
if undefined.
Gets the hashcode value of this URI instance.
Indicates whether this URI is absolute, which means that a scheme part is defined in this URI.
true
if this URI is absolute, false
otherwise.
Indicates whether this URI is opaque or not. An opaque URI is absolute and has a scheme-specific part which does not start with a slash character. All parts except scheme, scheme-specific and fragment are undefined.
true
if the URI is opaque, false
otherwise.
Normalizes the path part of this URI.
Tries to parse the authority component of this URI to divide it into the host, port, and user-info. If this URI is already determined as a ServerAuthority this instance will be returned without changes.
URISyntaxException | if the authority part could not be parsed as a server-based authority. |
---|
Makes the given URI relative
to a relative URI against the URI
represented by this instance.
relative | the URI which has to be relativized against this URI. |
---|
Creates a new URI instance by parsing the given string relative
and resolves the created URI against the URI represented by this
instance.
relative | the given string to create the new URI instance which has to be resolved later on. |
---|
Resolves the given URI relative
against the URI represented by
this instance.
relative | the URI which has to be resolved against this URI. |
---|
Returns the textual string representation of this URI instance using the US-ASCII encoding.
Returns the textual string representation of this URI instance.
Converts this URI instance to a URL.
MalformedURLException | if an error occurs while creating the URL or no protocol handler could be found. |
---|