org.apache.shindig.common.uri
Class Uri

java.lang.Object
  extended by org.apache.shindig.common.uri.Uri

public final class Uri
extends Object

Represents a Uniform Resource Identifier (URI) reference as defined by RFC 3986. Assumes that all url components are UTF-8 encoded.


Nested Class Summary
static class Uri.UriException
          Interim typed, but not checked, exception facilitating migration of Uri methods to throwing a checked UriException later.
 
Method Summary
 boolean equals(Object obj)
           
static Uri fromJavaUri(URI uri)
          Convert a java.net.URI to a Uri.
 String getAuthority()
           
 String getFragment()
           
 String getFragmentParameter(String name)
           
 Map<String,List<String>> getFragmentParameters()
           
 Collection<String> getFragmentParameters(String name)
           
 String getPath()
           
 String getQuery()
           
 String getQueryParameter(String name)
           
 Map<String,List<String>> getQueryParameters()
           
 Collection<String> getQueryParameters(String name)
           
 String getScheme()
           
 int hashCode()
           
 boolean isAbsolute()
           
static Uri parse(String text)
          Produces a new Uri from a text representation.
 Uri resolve(Uri relative)
          Derived from Harmony Resolves a given url relative to this url.
static void setUriParser(UriParser uriParser)
           
 URI toJavaUri()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

setUriParser

@Inject(optional=true)
public static void setUriParser(UriParser uriParser)

parse

public static Uri parse(String text)
Produces a new Uri from a text representation.

Parameters:
text - The text uri.
Returns:
A new Uri, parsed into components.

fromJavaUri

public static Uri fromJavaUri(URI uri)
Convert a java.net.URI to a Uri.


toJavaUri

public URI toJavaUri()
Returns:
a java.net.URI equal to this Uri.

resolve

public Uri resolve(Uri relative)
Derived from Harmony Resolves a given url relative to this url. Resolution rules are the same as for java.net.URI.resolve(URI)


isAbsolute

public boolean isAbsolute()
Returns:
True if the Uri is absolute.

getScheme

public String getScheme()
Returns:
The scheme part of the uri, or null if none was specified.

getAuthority

public String getAuthority()
Returns:
The authority part of the uri, or null if none was specified.

getPath

public String getPath()
Returns:
The path part of the uri, or null if none was specified.

getQuery

public String getQuery()
Returns:
The query part of the uri, or null if none was specified.

getQueryParameters

public Map<String,List<String>> getQueryParameters()
Returns:
The query part of the uri, separated into component parts.

getQueryParameters

public Collection<String> getQueryParameters(String name)
Returns:
All query parameters with the given name.

getQueryParameter

public String getQueryParameter(String name)
Returns:
The first query parameter value with the given name.

getFragment

public String getFragment()
Returns:
The uri fragment.

getFragmentParameters

public Map<String,List<String>> getFragmentParameters()
Returns:
The fragment part of the uri, separated into component parts.

getFragmentParameters

public Collection<String> getFragmentParameters(String name)
Returns:
All query parameters with the given name.

getFragmentParameter

public String getFragmentParameter(String name)
Returns:
The first query parameter value with the given name.

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2007-2012. All Rights Reserved.