String protocol = name.getProtocol(); String username = name.getUsername(); String password = name.getPassword(); String host = name.getHost(); int port = name.getPort();
/** * 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; }
port = url.getPort(); user = url.getUsername(); password = url.getPassword(); file = url.getFile();
port = url.getPort(); user = url.getUsername(); password = url.getPassword(); file = url.getFile();
user = url.getUsername(); if (password == null) // get password too if we need it password = url.getPassword(); } else { if (password == null && user.equals(url.getUsername())) password = url.getPassword();
user = url.getUsername(); if (password == null) // get password too if we need it password = url.getPassword(); } else { if (password == null && user.equals(url.getUsername())) password = url.getPassword();
/** * Create a new {@link Transport} using the {@link Session} returned by {@link JavaMailSenderImpl#getSession() getSession()}. * * @param key A {@link URLName} containing the connection details * @return A new {@link Transport} */ @Override public Object makeObject(Object key) throws Exception { if ((key instanceof URLName) == false) { throw new IllegalArgumentException("Invlid key type"); } log.debug("Creating new Transport"); URLName urlName = (URLName) key; Transport transport = getSession().getTransport(urlName.getProtocol()); transport.connect(urlName.getHost(), urlName.getPort(), urlName.getUsername(), urlName.getPassword()); return transport; }
/** * Create a new {@link Transport} using the {@link Session} returned by {@link JavaMailSenderImpl#getSession() getSession()}. * * @param key A {@link URLName} containing the connection details * @return A new {@link Transport} */ @Override public Object makeObject(Object key) throws Exception { if ((key instanceof URLName) == false) { throw new IllegalArgumentException("Invlid key type"); } log.debug("Creating new Transport"); URLName urlName = (URLName) key; Transport transport = getSession().getTransport(urlName.getProtocol()); transport.connect(urlName.getHost(), urlName.getPort(), urlName.getUsername(), urlName.getPassword()); return transport; }
@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()); }
@Override public synchronized 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()); }
@Override public synchronized 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()); }
public void connect() throws MessagingException { connect(url.getHost(), url.getPort(), url.getUsername(), url.getPassword()); }
/** * 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 synchronized URLName getURLName() { 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; }
/** * 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 synchronized URLName getURLName() { 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; }