public class URLName
extends java.lang.Object
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.
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
fullURL
The full version of the URL
|
Constructor and Description |
---|
URLName(java.lang.String url)
Construct a URLName from the string.
|
URLName(java.lang.String protocol,
java.lang.String host,
int port,
java.lang.String file,
java.lang.String username,
java.lang.String password)
Creates a URLName object from the specified protocol, host,
port number, file, username, and password.
|
URLName(java.net.URL url)
Construct a URLName from a java.net.URL object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
Compares two URLNames.
|
java.lang.String |
getFile()
Returns the file name of this URLName.
|
java.lang.String |
getHost()
Returns the host of this URLName.
|
java.lang.String |
getPassword()
Returns the password of this URLName.
|
int |
getPort()
Returns the port number of this URLName.
|
java.lang.String |
getProtocol()
Returns the protocol of this URLName.
|
java.lang.String |
getRef()
Returns the reference of this URLName.
|
java.net.URL |
getURL()
Constructs a URL from the URLName.
|
java.lang.String |
getUsername()
Returns the user name of this URLName.
|
int |
hashCode()
Compute the hash code for this URLName.
|
protected void |
parseString(java.lang.String url)
Method which does all of the work of parsing the string.
|
java.lang.String |
toString()
Constructs a string representation of this URLName.
|
public URLName(java.lang.String protocol, java.lang.String host, int port, java.lang.String file, java.lang.String username, java.lang.String password)
public URLName(java.net.URL url)
public URLName(java.lang.String url)
public int getPort()
public java.lang.String getProtocol()
public java.lang.String getFile()
public java.lang.String getRef()
public java.lang.String getHost()
public java.lang.String getUsername()
public java.lang.String getPassword()
public java.net.URL getURL() throws java.net.MalformedURLException
java.net.MalformedURLException
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
protected void parseString(java.lang.String url)