/** * Constructs a URL from the URLName. * * @return the URL * @exception MalformedURLException if the URL is malformed */ public URL getURL() throws MalformedURLException { return new URL(getProtocol(), getHost(), getPort(), getFile()); }
/** * Constructs a URL from the URLName. * * @return the URL * @exception MalformedURLException if the URL is malformed */ public URL getURL() throws MalformedURLException { // URL expects the file to include the separating "/" String f = getFile(); if (f == null) f = ""; else f = "/" + f; return new URL(getProtocol(), getHost(), getPort(), f); }
String username = name.getUsername(); String password = name.getPassword(); String host = name.getHost(); int port = name.getPort(); String file = name.getFile();
return new URLName(storeURL.getProtocol(), storeURL.getHost(), storeURL.getPort(), encodedName.toString(), storeURL.getUsername(),
return new URLName(storeURL.getProtocol(), storeURL.getHost(), storeURL.getPort(), encodedName.toString(), storeURL.getUsername(),
/** * Return a URLName representing this service. The returned URLName * does <em>not</em> include the password field. <p> * * Subclasses should only override this method if their * URLName does not follow the standard format. <p> * * The implementation in the Service class returns (usually a copy of) * the <code>url</code> field with the password and file information * stripped out. * * @return the URLName representing this service * @see URLName */ public URLName getURLName() { URLName url = this.url; // snapshot if (url != null && (url.getPassword() != null || url.getFile() != null)) return new URLName(url.getProtocol(), url.getHost(), url.getPort(), null /* no file */, url.getUsername(), null /* no password */); else return url; }
/** * Return a URLName representing this service. The returned URLName * does <em>not</em> include the password field. <p> * * Subclasses should only override this method if their * URLName does not follow the standard format. <p> * * The implementation in the Service class returns (usually a copy of) * the <code>url</code> field with the password and file information * stripped out. * * @return the URLName representing this service * @see URLName */ public URLName getURLName() { URLName url = this.url; // snapshot if (url != null && (url.getPassword() != null || url.getFile() != null)) return new URLName(url.getProtocol(), url.getHost(), url.getPort(), null /* no file */, url.getUsername(), null /* no password */); else return url; }
host = url.getHost(); port = url.getPort(); user = url.getUsername();
host = url.getHost(); port = url.getPort(); user = url.getUsername();
String transportHost = t.getURLName().getHost(); if (!isEmpty(transportHost)) { verifyHost(transportHost);
protocol = url.getProtocol(); if (host == null) host = url.getHost(); if (port == -1) port = url.getPort();
protocol = url.getProtocol(); if (host == null) host = url.getHost(); if (port == -1) port = url.getPort();
String transportHost = t.getURLName().getHost(); if (!isEmpty(transportHost)) { verifyHost(transportHost);
/** * Constructs a URL from the URLName. */ public URL getURL() throws MalformedURLException { return new URL(getProtocol(), getHost(), getPort(), getFile()); }
@Override public void connect(final String user, final String password) throws MessagingException { if (isConnected()) { throw new IllegalStateException("already connected"); } super.connect(url.getHost(), url.getPort(), user, password); }
@Override public void connect() throws MessagingException { if (isConnected()) { throw new IllegalStateException("already connected"); } super.connect(url.getHost(), url.getPort(), url.getUsername(), url.getPassword()); }
@Override public synchronized void connect() throws MessagingException { if (isConnected()) { throw new IllegalStateException("already connected"); } super.connect(url.getHost(), url.getPort(), url.getUsername(), url.getPassword()); }
/** * Return a copy of the URLName representing this service with the password and file information removed. * * @return the URLName for this service */ public URLName getURLName() { return url == null ? null : new URLName(url.getProtocol(), url.getHost(), url.getPort(), null, url.getUsername(), null); }
protected void setURLName(URLName url) { // host, user, password, and file don't matter so we strip them out if (url != null && (url.getUsername() != null || url.getHost() != null || url.getFile() != null)) url = new URLName(url.getProtocol(), null, -1, null, null, null); super.setURLName(url); }
/** * Return the URLName for this folder, which includes the location of the store. * * @return the URLName for this folder * @throws MessagingException */ public URLName getURLName() throws MessagingException { URLName baseURL = store.getURLName(); return new URLName(baseURL.getProtocol(), baseURL.getHost(), baseURL.getPort(), getFullName(), baseURL.getUsername(), null); }