|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.aduna.gee.publication.net.WURL
public class WURL
"W" Uniform Resource locator. This class can be compared to the java.net.URL class. Unfortunately the implementation of that class has a few restrictions that make it nessecary to implement a ZPad specific URL class. The two most important reasons to do that are:
| Field Summary | |
|---|---|
protected int |
_hash
Cache the hash code for the WURL. |
String |
file
The actual file name of the resource |
String |
host
The host to connect to |
String |
path
The actual directory path of the resource Most safe is to set the path via set path, it does the hard work for you. |
int |
port
The TCP/IP port to use. |
String |
protocol
The protocol to use to reach this location. |
| Constructor Summary | |
|---|---|
WURL(String spec)
Creates a URL object from the String representation of the resource location. |
|
WURL(URL URL)
Creates a URL equivalent to the java.net.URL. |
|
| Method Summary | |
|---|---|
protected void |
_parseURL(String spec)
Parses the URL string to break it up in protocol, host, port and file pieces. |
Object |
clone()
Clone this resource locator. |
boolean |
equals(Object obj)
Compares two URLs. |
static int |
findNearestSlash(String s,
int index)
Find the first slash in a string after a given position. |
String |
getServerPath()
Get the prefix, i.e. |
int |
hashCode()
To make the URL suitable for use in a hashtable, this object overrides the hashCode method of object. |
boolean |
sameFile(WURL other)
Compares two URLs. |
void |
setPath(String path)
Set the path part of the url. |
void |
setPhysical(String physical)
Set the physical part of the url. |
String |
toString()
Constructs a string representation of this URL. |
URL |
toURL()
Creates a java.net.URL from the WURL. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public String protocol
public String host
public int port
public String path
public String file
protected int _hash
| Constructor Detail |
|---|
public WURL(String spec)
throws MalformedURLException
MalformedURLException - when no legal URL
could be constructed.public WURL(URL URL)
URL - A java.net.URL equivalent.| Method Detail |
|---|
protected void _parseURL(String spec)
throws MalformedURLException
spec - the string with the URL specification
MalformedURLException - when we can't be more flexible
with the string, we go far, but you probably used some dirty
words or something.public boolean equals(Object obj)
equals in class Objectobj - the URL to compare against.
public boolean sameFile(WURL other)
other - the URL to compare against.
public void setPath(String path)
path - the remote path.public void setPhysical(String physical)
the - physical part of the url.
public static int findNearestSlash(String s,
int index)
s - the string to search in.index - the index to start from.
public String toString()
toString in class Object
public URL toURL()
throws MalformedURLException
MalformedURLException - When the native platform
cannot handle the specified fields in a URL.public final int hashCode()
hashCode in class Objectpublic Object clone()
clone in class Objectpublic String getServerPath()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||