FileDocCategorySizeDatePackage
PasswordAuthentication.javaAPI DocAndroid 1.5 API2112Wed May 06 22:41:04 BST 2009java.net

PasswordAuthentication

public final class PasswordAuthentication extends Object
This immutable class is a data structure that encapsulates username and password which is used by the {@code Authenticator} class.
see
Authenticator
since
Android 1.0

Fields Summary
private String
userName
private char[]
password
Constructors Summary
public PasswordAuthentication(String userName, char[] password)
Creates an instance of a password authentication with a specified username and password.

param
userName the username to store.
param
password the associated password to store.
since
Android 1.0

        this.userName = userName;
        this.password = password.clone();
    
Methods Summary
public char[]getPassword()
Gets a clone of the password stored by this instance. The user is responsible to finalize the returned array if the password clone is no longer needed.

return
the copied password.
since
Android 1.0

        return password.clone();
    
public java.lang.StringgetUserName()
Gets the username stored by this instance.

return
the stored username.
since
Android 1.0

        return userName;