| java.lang.Object | |
| ↳ | com.google.code.javax.mail.URLName |
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.
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int | caseDiff | ||||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| doEncode | A way to turn off encoding, just in case... | ||||||||||
| dontNeedEncoding | The class contains a utility method for converting a
String into a MIME format called
"x-www-form-urlencoded" format. |
||||||||||
| file | The specified file name on that host. | ||||||||||
| fullURL | The full version of the URL | ||||||||||
| hashCode | Our hash code. | ||||||||||
| host | The host name to which to connect. | ||||||||||
| hostAddress | The host's IP address, used in equals and hashCode. | ||||||||||
| hostAddressKnown | |||||||||||
| password | The password to use when connecting. | ||||||||||
| port | The protocol port to connect to. | ||||||||||
| protocol | The protocol to use (ftp, http, nntp, imap, pop3 ... | ||||||||||
| ref | # reference. | ||||||||||
| username | The username to use when connecting | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Creates a URLName object from the specified protocol,
host, port number, file, username, and password.
| |||||||||||
Construct a URLName from a java.net.URL object.
| |||||||||||
Construct a URLName from the string.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Compares two URLNames.
| |||||||||||
Returns the file name of this URLName.
| |||||||||||
Returns the host of this URLName.
| |||||||||||
Returns the password of this URLName.
| |||||||||||
Returns the port number of this URLName.
| |||||||||||
Returns the protocol of this URLName.
| |||||||||||
Returns the reference of this URLName.
| |||||||||||
Constructs a URL from the URLName.
| |||||||||||
Returns the user name of this URLName.
| |||||||||||
Compute the hash code for this URLName.
| |||||||||||
Constructs a string representation of this URLName.
| |||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Method which does all of the work of parsing the string.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
A way to turn off encoding, just in case...
The class contains a utility method for converting a
String into a MIME format called
"x-www-form-urlencoded" format.
To convert a String, each character is examined in turn:
a' through 'z',
'A' through 'Z', '0'
through '9', and ".", "-",
"*", "_" remain the same.
' is converted into a
plus sign '+'.
%xy", where xy is the two-digit
hexadecimal representation of the lower 8-bits of the character.
The specified file name on that host.
The full version of the URL
Our hash code.
The host name to which to connect.
The host's IP address, used in equals and hashCode. Computed on demand.
The password to use when connecting.
The protocol port to connect to.
The protocol to use (ftp, http, nntp, imap, pop3 ... etc.) .
# reference.
The username to use when connecting
Creates a URLName object from the specified protocol, host, port number, file, username, and password. Specifying a port number of -1 indicates that the URL should use the default port for the protocol.
| protocol | |
|---|---|
| host | |
| port | |
| file | |
| username | |
| password |
Construct a URLName from a java.net.URL object.
| url |
|---|
Construct a URLName from the string. Parses out all the possible information (protocol, host, port, file, username, password).
| url |
|---|
Compares two URLNames. The result is true if and only if the argument is not null and is a URLName object that represents the same URLName as this object. Two URLName objects are equal if they have the same protocol and the same host, the same port number on the host, the same username, and the same file on the host. The fields (host, username, file) are also considered the same if they are both null.
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.
| obj |
|---|
Returns the file name of this URLName. Returns null if this URLName has no file name.
Returns the host of this URLName. Returns null if this URLName has no host.
Returns the password of this URLName. Returns null if this URLName has no password.
Returns the port number of this URLName. Returns -1 if the port is not set.
Returns the protocol of this URLName. Returns null if this URLName has no protocol.
Returns the reference of this URLName. Returns null if this URLName has no reference.
Constructs a URL from the URLName.
| MalformedURLException |
|---|
Returns the user name of this URLName. Returns null if this URLName has no user name.
Compute the hash code for this URLName.
Constructs a string representation of this URLName.
Method which does all of the work of parsing the string.
| url |
|---|