|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sapia.ubik.net.Uri
public class Uri
This class models a URI.
Usage:
Uri httpURI = Uri.parse("http://www.sapia-oss.org:80/index.html");
// will print: http
System.out.println(httpURI.getScheme());
// will print: www.sapia-oss.org
System.out.println(httpURI.getHost());
// will print: 80
System.out.println(httpURI.getPort());
// will print: /index.html
System.out.println(httpURI.getPath());
Uri fileURI = Uri.parse("file:/some/directory/foo.txt");
// will print: file
System.out.println(fileURI.getScheme());
// these calls don't make sense:
System.out.println(fileURI.getHost());
System.out.println(fileURI.getHost());
// will print: /some/directory/foo.txt
System.out.println(fileURI.getPath());
| Field Summary | |
|---|---|
static java.lang.String |
UNDEFINED_HOST
|
static int |
UNDEFINED_PORT
|
| Constructor Summary | |
|---|---|
Uri(java.lang.String scheme,
java.lang.String host,
int port,
java.lang.String path)
|
|
| Method Summary | |
|---|---|
java.lang.String |
getHost()
Returns the host of this URI. |
java.lang.String |
getPath()
Returns the path of this URI. |
int |
getPort()
Returns the port of this URI. |
QueryString |
getQueryString()
Returns this instance's query string. |
java.lang.String |
getScheme()
Returns the scheme of this URI. |
static Uri |
parse(java.lang.String uriStr)
Parses the given URI string and returns its object representation. |
void |
setHost(java.lang.String host)
Sets this instance's host. |
void |
setPort(int port)
Sets this instance's port. |
void |
setScheme(java.lang.String scheme)
Sets this instance's scheme. |
java.lang.String |
toString()
Returns this instance's string format. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int UNDEFINED_PORT
public static final java.lang.String UNDEFINED_HOST
| Constructor Detail |
|---|
public Uri(java.lang.String scheme,
java.lang.String host,
int port,
java.lang.String path)
| Method Detail |
|---|
public java.lang.String getPath()
public java.lang.String getScheme()
public java.lang.String getHost()
public int getPort()
public void setScheme(java.lang.String scheme)
a - scheme.public void setHost(java.lang.String host)
a - host identifier.public void setPort(int port)
a - port.public QueryString getQueryString()
QueryString, or null
if this instance has no query string.public java.lang.String toString()
toString in class java.lang.ObjectString.
public static Uri parse(java.lang.String uriStr)
throws UriSyntaxException
Uri.
UriSyntaxException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||