Class AuthenticationBuilder
java.lang.Object
org.eclipse.aether.util.repository.AuthenticationBuilder
A utility class to build authentication info for repositories and proxies.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddCustom(Authentication authentication) Adds custom authentication data to the authentication.addHostnameVerifier(HostnameVerifier verifier) Adds a hostname verifier for SSL.Adds NTLM data to the authentication.addPassword(char[] password) Adds password data to the authentication.addPassword(String password) Adds password data to the authentication.addPrivateKey(String pathname, char[] passphrase) Adds private key data to the authentication.addPrivateKey(String pathname, String passphrase) Adds private key data to the authentication.Adds sensitive custom string data to the authentication.Adds sensitive custom string data to the authentication.Adds custom string data to the authentication.addUsername(String username) Adds username data to the authentication.build()Builds a new authentication object from the current data of this builder.
- 
Constructor Details- 
AuthenticationBuilderpublic AuthenticationBuilder()Creates a new authentication builder.
 
- 
- 
Method Details- 
buildBuilds a new authentication object from the current data of this builder. The state of the builder itself remains unchanged.- Returns:
- the authentication or nullif no authentication data was supplied to the builder
 
- 
addUsernameAdds username data to the authentication.- Parameters:
- username- the username, may be- null
- Returns:
- this builder for chaining, never null
 
- 
addPasswordAdds password data to the authentication.- Parameters:
- password- the password, may be- null
- Returns:
- this builder for chaining, never null
 
- 
addPasswordAdds password data to the authentication. The resulting authentication object uses an encrypted copy of the supplied character data and callers are advised to clear the input array soon after this method returns.- Parameters:
- password- the password, may be- null
- Returns:
- this builder for chaining, never null
 
- 
addNtlmAdds NTLM data to the authentication.- Parameters:
- workstation- the NTLM workstation name, may be- null
- domain- the NTLM domain name, may be- null
- Returns:
- this builder for chaining, never null
 
- 
addPrivateKeyAdds private key data to the authentication.- Parameters:
- pathname- the (absolute) path to the private key file, may be- null
- passphrase- the passphrase protecting the private key, may be- null
- Returns:
- this builder for chaining, never null
 
- 
addPrivateKeyAdds private key data to the authentication. The resulting authentication object uses an encrypted copy of the supplied character data and callers are advised to clear the input array soon after this method returns.- Parameters:
- pathname- the (absolute) path to the private key file, may be- null
- passphrase- the passphrase protecting the private key, may be- null
- Returns:
- this builder for chaining, never null
 
- 
addHostnameVerifierAdds a hostname verifier for SSL. Note: This method assumes that all possible instances of the verifier's runtime type exhibit the exact same behavior, i.e. the behavior of the verifier depends solely on the runtime type and not on any configuration. For verifiers that do not fit this assumption, useaddCustom(Authentication)with a suitable implementation instead.- Parameters:
- verifier- the hostname verifier, may be- null
- Returns:
- this builder for chaining, never null
 
- 
addStringAdds custom string data to the authentication. Note: If the string data is confidential, useaddSecret(String, char[])instead.- Parameters:
- key- the key for the authentication data, must not be- null
- value- the value for the authentication data, may be- null
- Returns:
- this builder for chaining, never null
 
- 
addSecretAdds sensitive custom string data to the authentication.- Parameters:
- key- the key for the authentication data, must not be- null
- value- the value for the authentication data, may be- null
- Returns:
- this builder for chaining, never null
 
- 
addSecretAdds sensitive custom string data to the authentication. The resulting authentication object uses an encrypted copy of the supplied character data and callers are advised to clear the input array soon after this method returns.- Parameters:
- key- the key for the authentication data, must not be- null
- value- the value for the authentication data, may be- null
- Returns:
- this builder for chaining, never null
 
- 
addCustomAdds custom authentication data to the authentication.- Parameters:
- authentication- the authentication to add, may be- null
- Returns:
- this builder for chaining, never null
 
 
-