commons-email2-jakarta/src/main/java/org/apache/commons/mail2/jakarta/DefaultAuthenticator.java [27:51]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class DefaultAuthenticator extends Authenticator {

    /** Stores the login information for authentication. */
    private final PasswordAuthentication authentication;

    /**
     * Default constructor.
     *
     * @param userName user name to use when authentication is requested
     * @param password password to use when authentication is requested
     * @since 1.0
     */
    public DefaultAuthenticator(final String userName, final String password) {
        this.authentication = new PasswordAuthentication(userName, password);
    }

    /**
     * Gets the authentication object that will be used to login to the mail server.
     *
     * @return A {@code PasswordAuthentication} object containing the login information.
     * @since 1.0
     */
    @Override
    protected PasswordAuthentication getPasswordAuthentication() {
        return authentication;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



commons-email2-javax/src/main/java/org/apache/commons/mail2/javax/DefaultAuthenticator.java [27:51]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class DefaultAuthenticator extends Authenticator {

    /** Stores the login information for authentication. */
    private final PasswordAuthentication authentication;

    /**
     * Default constructor.
     *
     * @param userName user name to use when authentication is requested
     * @param password password to use when authentication is requested
     * @since 1.0
     */
    public DefaultAuthenticator(final String userName, final String password) {
        this.authentication = new PasswordAuthentication(userName, password);
    }

    /**
     * Gets the authentication object that will be used to login to the mail server.
     *
     * @return A {@code PasswordAuthentication} object containing the login information.
     * @since 1.0
     */
    @Override
    protected PasswordAuthentication getPasswordAuthentication() {
        return authentication;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



