org.sonatype.aether.util.repository
Class ConservativeAuthenticationSelector
java.lang.Object
org.sonatype.aether.util.repository.ConservativeAuthenticationSelector
- All Implemented Interfaces:
- AuthenticationSelector
public class ConservativeAuthenticationSelector
- extends Object
- implements AuthenticationSelector
An authentication selector that delegates to another selector but only if a repository has no authentication data
yet. If authentication has already been assigned to a repository, that is selected.
- Author:
- Benjamin Bentmann
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConservativeAuthenticationSelector
public ConservativeAuthenticationSelector(AuthenticationSelector selector)
- Creates a new selector that delegates to the specified selector.
- Parameters:
selector
- The selector to delegate to in case a repository has no authentication yet, must not be null
.
getAuthentication
public Authentication getAuthentication(RemoteRepository repository)
- Description copied from interface:
AuthenticationSelector
- Selects authentication for the specified remote repository.
- Specified by:
getAuthentication
in interface AuthenticationSelector
- Parameters:
repository
- The repository for which to select authentication, must not be null
.
- Returns:
- The selected authentication or
null
if none.
Copyright © 2010-2011 Sonatype, Inc.. All Rights Reserved.