org.sonatype.aether.repository
Class Authentication

java.lang.Object
  extended by org.sonatype.aether.repository.Authentication

public final class Authentication
extends Object

The authentication to use for accessing a protected resource. Note: Instances of this class are immutable and the exposed mutators return new objects rather than changing the current instance.

Author:
Benjamin Bentmann

Constructor Summary
Authentication(String username, char[] password)
          Creates a basic username+password authentication.
Authentication(String username, char[] password, String privateKeyFile, char[] passphrase)
          Creates a new authentication with the specified properties
Authentication(String username, String password)
          Creates a basic username+password authentication.
Authentication(String username, String password, String privateKeyFile, String passphrase)
          Creates a new authentication with the specified properties
 
Method Summary
 boolean equals(Object obj)
           
 String getPassphrase()
          Gets the passphrase for the private key.
 String getPassword()
          Gets the password.
 String getPrivateKeyFile()
          Gets the path to the private key file to use for authentication.
 String getUsername()
          Gets the username.
 int hashCode()
           
 Authentication setPassphrase(char[] passphrase)
          Sets the passphrase for the private key file.
 Authentication setPassphrase(String passphrase)
          Sets the passphrase for the private key file.
 Authentication setPassword(char[] password)
          Sets the password to use for authentication.
 Authentication setPassword(String password)
          Sets the password to use for authentication.
 Authentication setPrivateKeyFile(String privateKeyFile)
          Sets the path to the private key file to use for authentication.
 Authentication setUsername(String username)
          Sets the username to use for authentication.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Authentication

public Authentication(String username,
                      char[] password,
                      String privateKeyFile,
                      char[] passphrase)
Creates a new authentication with the specified properties

Parameters:
username - The username, may be null.
password - The password, may be null.
privateKeyFile - The path to the private key file, may be null.
passphrase - The passphrase for the private key file, may be null.

Authentication

public Authentication(String username,
                      String password,
                      String privateKeyFile,
                      String passphrase)
Creates a new authentication with the specified properties

Parameters:
username - The username, may be null.
password - The password, may be null.
privateKeyFile - The path to the private key file, may be null.
passphrase - The passphrase for the private key file, may be null.

Authentication

public Authentication(String username,
                      String password)
Creates a basic username+password authentication.

Parameters:
username - The username, may be null.
password - The password, may be null.

Authentication

public Authentication(String username,
                      char[] password)
Creates a basic username+password authentication.

Parameters:
username - The username, may be null.
password - The password, may be null.
Method Detail

getUsername

public String getUsername()
Gets the username.

Returns:
The username or null if none.

setUsername

public Authentication setUsername(String username)
Sets the username to use for authentication.

Parameters:
username - The username, may be null.
Returns:
The new authentication, never null.

getPassword

public String getPassword()
Gets the password.

Returns:
The password or null if none.

setPassword

public Authentication setPassword(String password)
Sets the password to use for authentication.

Parameters:
password - The password, may be null.
Returns:
The new authentication, never null.

setPassword

public Authentication setPassword(char[] password)
Sets the password to use for authentication.

Parameters:
password - The password, may be null.
Returns:
The new authentication, never null.

getPrivateKeyFile

public String getPrivateKeyFile()
Gets the path to the private key file to use for authentication.

Returns:
The path to the private key file or null if none.

setPrivateKeyFile

public Authentication setPrivateKeyFile(String privateKeyFile)
Sets the path to the private key file to use for authentication.

Parameters:
privateKeyFile - The path to the private key file, may be null.
Returns:
The new authentication, never null.

getPassphrase

public String getPassphrase()
Gets the passphrase for the private key.

Returns:
The passphrase for the private key or null if none.

setPassphrase

public Authentication setPassphrase(String passphrase)
Sets the passphrase for the private key file.

Parameters:
passphrase - The passphrase for the private key file, may be null.
Returns:
The new authentication, never null.

setPassphrase

public Authentication setPassphrase(char[] passphrase)
Sets the passphrase for the private key file.

Parameters:
passphrase - The passphrase for the private key file, may be null.
Returns:
The new authentication, never null.

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2010-2013. All Rights Reserved.