Package com.sun.mail.util.logging
Class MailHandler.DefaultAuthenticator
- java.lang.Object
-
- javax.mail.Authenticator
-
- com.sun.mail.util.logging.MailHandler.DefaultAuthenticator
-
- Enclosing class:
- MailHandler
private static final class MailHandler.DefaultAuthenticator extends Authenticator
Used for storing a password from the LogManager or literal string.- Since:
- JavaMail 1.4.6
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
pass
The password to use.
-
Constructor Summary
Constructors Modifier Constructor Description private
DefaultAuthenticator(java.lang.String pass)
Use the factory method instead of this constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PasswordAuthentication
getPasswordAuthentication()
Called when password authentication is needed.(package private) static Authenticator
of(java.lang.String pass)
Creates an Authenticator for the given password.-
Methods inherited from class javax.mail.Authenticator
getDefaultUserName, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingSite
-
-
-
-
Method Detail
-
of
static Authenticator of(java.lang.String pass)
Creates an Authenticator for the given password. This method is used so class verification of assignments in MailHandler doesn't require loading this class which otherwise can occur when using the constructor. Default access to avoid generating extra class files.- Parameters:
pass
- the password.- Returns:
- an Authenticator for the password.
- Since:
- JavaMail 1.5.6
-
getPasswordAuthentication
protected final PasswordAuthentication getPasswordAuthentication()
Description copied from class:Authenticator
Called when password authentication is needed. Subclasses should override the default implementation, which returns null.Note that if this method uses a dialog to prompt the user for this information, the dialog needs to block until the user supplies the information. This method can not simply return after showing the dialog.
- Overrides:
getPasswordAuthentication
in classAuthenticator
- Returns:
- The PasswordAuthentication collected from the user, or null if none is provided.
-
-