| Method from javax.mail.URLName Detail: |
public boolean equals(Object o) {
if (o instanceof URLName == false) {
return false;
}
URLName other = (URLName) o;
// check same protocol - false if either is null
if (protocol == null || other.protocol == null || !protocol.equals(other.protocol)) {
return false;
}
if (port != other.port) {
return false;
}
// check host - false if not (both null or both equal)
return areSame(host, other.host) && areSame(file, other.file) && areSame(username, other.username) && areSame(password, other.password);
}
|
public String getFile() {
return file;
}
|
public String getHost() {
return host;
}
|
public String getPassword() {
return password;
}
|
public int getPort() {
return port;
}
|
public String getProtocol() {
return protocol;
}
|
public String getRef() {
return ref;
}
|
public URL getURL() throws MalformedURLException {
return new URL(fullURL);
}
|
public String getUsername() {
return username;
}
|
public int hashCode() {
return hashCode;
}
|
protected void parseString(String url) {
URI uri;
try {
if (url == null) {
uri = null;
} else {
uri = new URI(url);
}
} catch (URISyntaxException e) {
uri = null;
}
if (uri == null) {
protocol = null;
host = null;
port = -1;
file = null;
ref = null;
username = null;
password = null;
return;
}
protocol = checkBlank(uri.getScheme());
host = checkBlank(uri.getHost());
port = uri.getPort();
file = checkBlank(uri.getPath());
ref = checkBlank(uri.getFragment());
String userInfo = checkBlank(uri.getUserInfo());
if (userInfo == null) {
username = null;
password = null;
} else {
int pos = userInfo.indexOf(':");
if (pos == -1) {
username = userInfo;
password = null;
} else {
username = userInfo.substring(0, pos);
password = userInfo.substring(pos + 1);
}
}
updateFullURL();
}
|
public String toString() {
return fullURL;
}
|