org.openrdf.util.uri
Class URI

java.lang.Object
  extended byorg.openrdf.util.uri.URI
All Implemented Interfaces:
Cloneable

public class URI
extends Object
implements Cloneable

A replacement for Java's own URI: java.net.URI. Java's implementation is quite buggy in that it doesn't resolve relative URIs correctly. Note: this implementation is not guaranteed to handle ipv6 addresses correctly (yet).


Constructor Summary
URI(String uriSpec)
           
URI(String scheme, String schemeSpecificPart, String fragment)
           
URI(String scheme, String authority, String path, String query, String fragment)
           
 
Method Summary
 Object clone()
           
 String getAuthority()
           
 String getFragment()
           
 String getPath()
           
 String getQuery()
           
 String getScheme()
           
 String getSchemeSpecificPart()
           
 boolean isAbsolute()
           
 boolean isHierarchical()
           
 boolean isOpaque()
           
 boolean isRelative()
           
 boolean isSelfReference()
          Checks whether this URI is a relative URI that references itself (i.e. it only contains an anchor).
 void normalize()
          Normalizes the path of this URI if it has one.
 URI resolve(String relUriSpec)
          Resolves a relative URI using this URI as the base URI.
 URI resolve(URI relUri)
          Resolves a relative URI using this URI as the base URI.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URI

public URI(String uriSpec)

URI

public URI(String scheme,
           String schemeSpecificPart,
           String fragment)

URI

public URI(String scheme,
           String authority,
           String path,
           String query,
           String fragment)
Method Detail

isHierarchical

public boolean isHierarchical()

isOpaque

public boolean isOpaque()

isAbsolute

public boolean isAbsolute()

isRelative

public boolean isRelative()

isSelfReference

public boolean isSelfReference()
Checks whether this URI is a relative URI that references itself (i.e. it only contains an anchor).


getScheme

public String getScheme()

getSchemeSpecificPart

public String getSchemeSpecificPart()

getAuthority

public String getAuthority()

getPath

public String getPath()

getQuery

public String getQuery()

getFragment

public String getFragment()

normalize

public void normalize()
Normalizes the path of this URI if it has one. Normalizing a path means that any unnecessary '.' and '..' segments are removed. For example, the URI http://server.com/a/b/../c/./d would be normalized to http://server.com/a/c/d. A URI doens't have a path if it is opaque.


resolve

public URI resolve(String relUriSpec)
Resolves a relative URI using this URI as the base URI.


resolve

public URI resolve(URI relUri)
Resolves a relative URI using this URI as the base URI.


toString

public String toString()

clone

public Object clone()


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.