Build 1.0_r1(from source)

java.net
Class URI

java.lang.Object
  extended by java.net.URI
All Implemented Interfaces:
Serializable, Comparable<URI>

public final class URI
extends Object
implements Comparable<URI>, Serializable

This class represents an instance of a URI as defined by RFC 2396.

See Also:
Serialized Form

Field Summary
(package private) static String allLegal
           
(package private) static String punct
           
(package private) static String reserved
           
(package private) static String someLegal
           
(package private) static String unreserved
           
 
Constructor Summary
URI(String uri)
           
URI(String scheme, String ssp, String frag)
           
URI(String scheme, String userinfo, String host, int port, String path, String query, String fragment)
           
URI(String scheme, String host, String path, String fragment)
           
URI(String scheme, String authority, String path, String query, String fragment)
           
 
Method Summary
 int compareTo(URI uri)
          Returns an integer indicating the relative positions of the receiver and the argument in the natural order of elements of the receiver's class.
static URI create(String uri)
           
 boolean equals(Object o)
          Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
 String getAuthority()
           
 String getFragment()
          Returns the fragment component.
 String getHost()
          Returns the host component.
 String getPath()
          Returns the path component.
 int getPort()
          Returns the port number.
 String getQuery()
          Returns the query component.
 String getRawAuthority()
          Returns the authority component in raw form.
 String getRawFragment()
          Returns the fragment component in raw form.
 String getRawPath()
          Returns the path component in raw form.
 String getRawQuery()
          Returns the query component in raw form.
 String getRawSchemeSpecificPart()
          Returns the scheme-specific part component in raw form.
 String getRawUserInfo()
          Returns the user-info component in raw form.
 String getScheme()
          Returns the scheme.
 String getSchemeSpecificPart()
          Returns the scheme-specific part component.
 String getUserInfo()
          Returns the userinfo.
 int hashCode()
          Returns an integer hash code for the receiver.
 boolean isAbsolute()
          Indicates whether this URI is absolute
 boolean isOpaque()
          Indicates whether this URI is opaque
 URI normalize()
           
 URI parseServerAuthority()
          Return this uri instance if it has already been determined as a ServerAuthority Otherwise try to parse it again as a server authority to produce a URISyntaxException with the proper diagnostic message.
 URI relativize(URI relative)
           
 URI resolve(String relative)
           
 URI resolve(URI relative)
           
 String toASCIIString()
           
 String toString()
          Returns a string containing a concise, human-readable description of the receiver.
 URL toURL()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

unreserved

static final String unreserved
See Also:
Constant Field Values

punct

static final String punct
See Also:
Constant Field Values

reserved

static final String reserved
See Also:
Constant Field Values

someLegal

static final String someLegal
See Also:
Constant Field Values

allLegal

static final String allLegal
See Also:
Constant Field Values
Constructor Detail

URI

public URI(String uri)
    throws URISyntaxException
Throws:
URISyntaxException

URI

public URI(String scheme,
           String ssp,
           String frag)
    throws URISyntaxException
Throws:
URISyntaxException

URI

public URI(String scheme,
           String userinfo,
           String host,
           int port,
           String path,
           String query,
           String fragment)
    throws URISyntaxException
Throws:
URISyntaxException

URI

public URI(String scheme,
           String host,
           String path,
           String fragment)
    throws URISyntaxException
Throws:
URISyntaxException

URI

public URI(String scheme,
           String authority,
           String path,
           String query,
           String fragment)
    throws URISyntaxException
Throws:
URISyntaxException
Method Detail

compareTo

public int compareTo(URI uri)
Description copied from interface: Comparable
Returns an integer indicating the relative positions of the receiver and the argument in the natural order of elements of the receiver's class.

Specified by:
compareTo in interface Comparable<URI>
Parameters:
uri - Object an object to compare the receiver to
Returns:
int which should be <0 if="" the="" receiver="" should="" sort="" before="" the="" argument,="" 0="" if="" the="" receiver="" should="" sort="" in="" the="" same="" position="" as="" the="" argument,="" and="">0 if the receiver should sort after the argument.

create

public static URI create(String uri)

equals

public boolean equals(Object o)
Description copied from class: Object
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. The implementation in Object returns true only if the argument is the exact same object as the receiver (==).

Overrides:
equals in class Object
Parameters:
o - Object the object to compare with this object.
Returns:
boolean true if the object is the same as this object false if it is different from this object.
See Also:
Object.hashCode()

getAuthority

public String getAuthority()

getFragment

public String getFragment()
Returns the fragment component.

Returns:
String

getHost

public String getHost()
Returns the host component.

Returns:
String

getPath

public String getPath()
Returns the path component.

Returns:
String

getPort

public int getPort()
Returns the port number.

Returns:
int

getQuery

public String getQuery()
Returns the query component.

Returns:
String

getRawAuthority

public String getRawAuthority()
Returns the authority component in raw form.

Returns:
String

getRawFragment

public String getRawFragment()
Returns the fragment component in raw form.

Returns:
String

getRawPath

public String getRawPath()
Returns the path component in raw form.

Returns:
String

getRawQuery

public String getRawQuery()
Returns the query component in raw form.

Returns:
String

getRawSchemeSpecificPart

public String getRawSchemeSpecificPart()
Returns the scheme-specific part component in raw form.

Returns:
String

getRawUserInfo

public String getRawUserInfo()
Returns the user-info component in raw form.

Returns:
String

getScheme

public String getScheme()
Returns the scheme.

Returns:
String

getSchemeSpecificPart

public String getSchemeSpecificPart()
Returns the scheme-specific part component.

Returns:
String

getUserInfo

public String getUserInfo()
Returns the userinfo.

Returns:
String

hashCode

public int hashCode()
Description copied from class: Object
Returns an integer hash code for the receiver. Any two objects which answer true when passed to .equals must answer the same value for this method.

Overrides:
hashCode in class Object
Returns:
int the receiver's hash.
See Also:
Object.equals(java.lang.Object)

isAbsolute

public boolean isAbsolute()
Indicates whether this URI is absolute

Returns:
boolean

isOpaque

public boolean isOpaque()
Indicates whether this URI is opaque

Returns:
true if the URI is opaque, otherwise false

normalize

public URI normalize()

parseServerAuthority

public URI parseServerAuthority()
                         throws URISyntaxException
Return this uri instance if it has already been determined as a ServerAuthority Otherwise try to parse it again as a server authority to produce a URISyntaxException with the proper diagnostic message.

Throws:
URISyntaxException

relativize

public URI relativize(URI relative)

resolve

public URI resolve(URI relative)

resolve

public URI resolve(String relative)

toASCIIString

public String toASCIIString()

toString

public String toString()
Description copied from class: Object
Returns a string containing a concise, human-readable description of the receiver.

Overrides:
toString in class Object
Returns:
String a printable representation for the receiver.

toURL

public URL toURL()
          throws MalformedURLException
Throws:
MalformedURLException

Build 1.0_r1(from source)

Please submit a feedback, bug or feature