| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public class URLName extends Object
The name of a URL. This class represents a URL name and also provides the basic parsing functionality to parse most internet standard URL schemes.
Note that this class differs from java.net.URL
in that this class just represents the name of a URL, it does
not model the connection to a URL.
Field Summary | |
---|---|
protected String |
fullURL
The full version of the URL |
Constructor Summary | |
---|---|
Construct a URLName from the string. |
|
Creates a URLName object from the specified protocol, host, port number, file, username, and password. |
|
Construct a URLName from a java.net.URL object. |
Method Summary | |
---|---|
boolean |
Compares two URLNames. |
String |
getFile() Returns the file name of this URLName. |
String |
getHost() Returns the host of this URLName. |
String |
Returns the password of this URLName. |
int |
getPort() Returns the port number of this URLName. |
String |
Returns the protocol of this URLName. |
String |
getRef() Returns the reference of this URLName. |
URL |
getURL() Constructs a URL from the URLName. |
String |
Returns the user name of this URLName. |
int |
hashCode() Compute the hash code for this URLName. |
protected void |
parseString(String url) Method which does all of the work of parsing the string. |
String |
toString() Constructs a string representation of this URLName. |
Field Detail |
---|
protected String fullURL
Constructor Detail |
---|
public URLName(String url)
url
public URLName(String protocol, String host, int port, String file, String username, String password)
protocol
host
port
file
username
password
public URLName(URL url)
url
Method Detail |
---|
public boolean equals(Object obj)
Hosts are considered equal if the names are equal (case independent) or if host name lookups for them both succeed and they both reference the same IP address.
Note that URLName has no knowledge of default port numbers for particular protocols, so "imap://host" and "imap://host:143" would not compare as equal.
Note also that the password field is not included in the comparison, nor is any reference field appended to the filename.
equals
in class Object
obj
public String getFile()
public String getHost()
public String getPassword()
public int getPort()
public String getProtocol()
public String getRef()
public URL getURL() throws MalformedURLException
MalformedURLException
public String getUsername()
public int hashCode()
hashCode
in class Object
protected void parseString(String url)
url
public String toString()
toString
in class Object
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |