/** * 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 password = name.getPassword(); String host = name.getHost(); int port = name.getPort(); String file = name.getFile(); String ref = name.getRef();
storeURL.getPort(), encodedName.toString(), storeURL.getUsername(),
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; }
protocol = url.getProtocol(); host = url.getHost(); port = url.getPort(); user = url.getUsername(); password = url.getPassword();
protocol = url.getProtocol(); host = url.getHost(); port = url.getPort(); user = url.getUsername(); password = url.getPassword();
host = url.getHost(); if (port == -1) port = url.getPort();
host = url.getHost(); if (port == -1) port = url.getPort();
@Override public void connect(final String host, final String user, final String password) throws MessagingException { if (isConnected()) { throw new IllegalStateException("already connected"); } super.connect(host, url.getPort(), user, password); }
@Override public synchronized void connect(final String host, final String user, final String password) throws MessagingException { if (isConnected()) { throw new IllegalStateException("already connected"); } super.connect(host, url.getPort(), user, password); }
/** * 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(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 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); }
/** * 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); }