public void setProtocol(String protocol) { if (this.url != null) { Assert.isTrue(this.url.getProtocol().equals(protocol), "The 'protocol' does not match that provided by the Store URI."); } this.protocol = protocol; }
private void verifyProtocol() { if (StringUtils.hasText(this.storeUri)) { URLName urlName = new URLName(this.storeUri); if (this.protocol == null) { this.protocol = urlName.getProtocol(); } else { Assert.isTrue(this.protocol.equals(urlName.getProtocol()), "The provided 'protocol' does not match that in the 'storeUri'."); } } else { Assert.hasText(this.protocol, "Either the 'storeUri' or 'protocol' is required."); } Assert.hasText(this.protocol, "Unable to resolve protocol."); }
/** * Get a Transport object for the given URLName. If the requested * Transport object cannot be obtained, NoSuchProviderException is thrown. * * The "scheme" part of the URL string (Refer RFC 1738) is used * to locate the Transport protocol. <p> * * @param url URLName that represents the desired Transport * @return a closed Transport object * @see javax.mail.URLName * @exception NoSuchProviderException If a provider for the given * URLName is not found. */ public Transport getTransport(URLName url) throws NoSuchProviderException { String protocol = url.getProtocol(); Provider p = getProvider(protocol); return getTransport(p, url); }
/** * Get a Transport object for the given URLName. If the requested * Transport object cannot be obtained, NoSuchProviderException is thrown. * * The "scheme" part of the URL string (Refer RFC 1738) is used * to locate the Transport protocol. <p> * * @param url URLName that represents the desired Transport * @return a closed Transport object * @see javax.mail.URLName * @exception NoSuchProviderException If a provider for the given * URLName is not found. */ public Transport getTransport(URLName url) throws NoSuchProviderException { String protocol = url.getProtocol(); Provider p = getProvider(protocol); return getTransport(p, url); }
/** * 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()); }
/** * Get a Store object for the given URLName. If the requested Store * object cannot be obtained, NoSuchProviderException is thrown. * * The "scheme" part of the URL string (Refer RFC 1738) is used * to locate the Store protocol. <p> * * @param url URLName that represents the desired Store * @return a closed Store object * @see #getFolder(URLName) * @see javax.mail.URLName * @exception NoSuchProviderException If a provider for the given * URLName is not found. */ public Store getStore(URLName url) throws NoSuchProviderException { String protocol = url.getProtocol(); Provider p = getProvider(protocol); return getStore(p, url); }
/** * Get a Store object for the given URLName. If the requested Store * object cannot be obtained, NoSuchProviderException is thrown. * * The "scheme" part of the URL string (Refer RFC 1738) is used * to locate the Store protocol. <p> * * @param url URLName that represents the desired Store * @return a closed Store object * @see #getFolder(URLName) * @see javax.mail.URLName * @exception NoSuchProviderException If a provider for the given * URLName is not found. */ public Store getStore(URLName url) throws NoSuchProviderException { String protocol = url.getProtocol(); Provider p = getProvider(protocol); return getStore(p, url); }
/** * 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 protocol = name.getProtocol(); String username = name.getUsername(); String password = name.getPassword();
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; }
super(session, url); if (url != null) name = url.getProtocol(); this.name = name; logger = new MailLogger(this.getClass(),
super(session, url); if (url != null) name = url.getProtocol(); this.name = name; logger = new MailLogger(this.getClass(), "DEBUG POP3",
protocol = url.getProtocol(); host = url.getHost(); port = url.getPort();
protocol = url.getProtocol(); host = url.getHost(); port = url.getPort();
"mail.debug.auth.password", false); if (urlname != null) name = urlname.getProtocol(); this.name = name; if (!isSSL)
"mail.debug.auth.password", false); if (urlname != null) name = urlname.getProtocol(); this.name = name; if (!isSSL)
protocol = url.getProtocol(); if (host == null) host = url.getHost();