ord char array is cleared automatically
Another approach:
String username = ... char[] password = ... Credentials login = new Credentials(); login.setUsername(username); login.setPassword(password) //password char array is cleared automatically
For testing purposes you can construct Credentials
with help of {@link LoginDialog#show(String)}
Credentials login = LoginDialog.show("Gmail Login");
There are more methods of interest:
- {@link #validate()} checks ifusername and password were provided and throws {@link GmailException} in casesomething is missing.
- {@link #dispose()} clears the username and password to prevent further use.
@author Tomas Varaneckas <tomas.varaneckas@gmail.com>
@version $Id: Credentials.java 37 2009-07-09 17:26:41Z tomas.varaneckas $
@since 0.1