Save This Page
Home » apache-harmony-6.0-src-r917296-snapshot » java » net » [javadoc | source]
java.net
public final class: URI [javadoc | source]
java.lang.Object
   java.net.URI

All Implemented Interfaces:
    Comparable, Serializable

This class represents an instance of a URI as defined by RFC 2396.
Field Summary
static final  String unreserved     
static final  String punct     
static final  String reserved     
static final  String someLegal     
static final  String allLegal     
Constructor:
 public URI(String uri) throws URISyntaxException 
    Creates a new URI instance according to the given string {@code uri}.
    Parameters:
    uri - the textual URI representation to be parsed into a URI object.
    Throws:
    URISyntaxException - if the given string {@code uri} doesn't fit to the specification RFC2396 or could not be parsed correctly.
 public URI(String scheme,
    String ssp,
    String frag) throws URISyntaxException 
    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.

    {@code [scheme:]scheme-specific-part[#fragment]}

    Parameters:
    scheme - the scheme part of the URI.
    ssp - the scheme-specific-part of the URI.
    frag - the fragment part of the URI.
    Throws:
    URISyntaxException - if the temporary created string doesn't fit to the specification RFC2396 or could not be parsed correctly.
 public URI(String scheme,
    String host,
    String path,
    String fragment) throws URISyntaxException 
    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.

    {@code [scheme:]host[path][#fragment]}

    Parameters:
    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.
    Throws:
    URISyntaxException - if the temporary created string doesn't fit to the specification RFC2396 or could not be parsed correctly.
 public URI(String scheme,
    String authority,
    String path,
    String query,
    String fragment) throws URISyntaxException 
    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.

    {@code [scheme:][//authority][path][?query][#fragment]}

    Parameters:
    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.
    Throws:
    URISyntaxException - if the temporary created string doesn't fit to the specification RFC2396 or could not be parsed correctly.
 public URI(String scheme,
    String userinfo,
    String host,
    int port,
    String path,
    String query,
    String fragment) throws URISyntaxException 
    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.

    {@code [scheme:][user-info@]host[:port][path][?query][#fragment]}

    Parameters:
    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.
    Throws:
    URISyntaxException - if the temporary created string doesn't fit to the specification RFC2396 or could not be parsed correctly.
Method from java.net.URI Summary:
compareTo,   create,   equals,   getAuthority,   getFragment,   getHost,   getPath,   getPort,   getQuery,   getRawAuthority,   getRawFragment,   getRawPath,   getRawQuery,   getRawSchemeSpecificPart,   getRawUserInfo,   getScheme,   getSchemeSpecificPart,   getUserInfo,   hashCode,   isAbsolute,   isOpaque,   normalize,   parseServerAuthority,   relativize,   resolve,   resolve,   toASCIIString,   toString,   toURL
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.net.URI Detail:
 public int compareTo(URI uri) 
    Compares this URI with the given argument {@code 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 {@code 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 orderer in the natural case-sensitive way. A hierarchical URI is less than an opaque URI and if one part is {@code null} the URI with the undefined part is less than the other one.
 public static URI create(String uri) 
    Parses the given argument {@code uri} and creates an appropriate URI instance.
 public boolean equals(Object o) 
    Compares this URI instance with the given argument {@code o} and determines if both are equal. Two URI instances are equal if all single parts are identical in their meaning.
 public String getAuthority() 
    Gets the decoded authority part of this URI.
 public String getFragment() 
    Gets the decoded fragment part of this URI.
 public String getHost() 
    Gets the host part of this URI.
 public String getPath() 
    Gets the decoded path part of this URI.
 public int getPort() 
    Gets the port number of this URI.
 public String getQuery() 
    Gets the decoded query part of this URI.
 public String getRawAuthority() 
    Gets the authority part of this URI in raw form.
 public String getRawFragment() 
    Gets the fragment part of this URI in raw form.
 public String getRawPath() 
    Gets the path part of this URI in raw form.
 public String getRawQuery() 
    Gets the query part of this URI in raw form.
 public String getRawSchemeSpecificPart() 
    Gets the scheme-specific part of this URI in raw form.
 public String getRawUserInfo() 
    Gets the user-info part of this URI in raw form.
 public String getScheme() 
    Gets the scheme part of this URI.
 public String getSchemeSpecificPart() 
    Gets the decoded scheme-specific part of this URI.
 public String getUserInfo() 
    Gets the decoded user-info part of this URI.
 public int hashCode() 
    Gets the hashcode value of this URI instance.
 public boolean isAbsolute() 
    Indicates whether this URI is absolute, which means that a scheme part is defined in this URI.
 public boolean isOpaque() 
    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.
 public URI normalize() 
    Normalizes the path part of this URI.
 public URI parseServerAuthority() throws URISyntaxException 
    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.
 public URI relativize(URI relative) 
    Makes the given URI {@code relative} to a relative URI against the URI represented by this instance.
 public URI resolve(URI relative) 
    Resolves the given URI {@code relative} against the URI represented by this instance.
 public URI resolve(String relative) 
    Creates a new URI instance by parsing the given string {@code relative} and resolves the created URI against the URI represented by this instance.
 public String toASCIIString() 
    Returns the textual string representation of this URI instance using the US-ASCII encoding.
 public String toString() 
    Returns the textual string representation of this URI instance.
 public URL toURL() throws MalformedURLException 
    Converts this URI instance to a URL.