public Authentication getAuthentication( RemoteRepository repository ) { return repository.getAuthentication(); }
public Authentication getAuthentication( RemoteRepository repository ) { Authentication auth = repository.getAuthentication(); if ( auth != null ) { return auth; } return selector.getAuthentication( repository ); }
/** * Convert a list of repositories into a list of strings. * @param repos The list of them * @return The list of texts */ private static Collection<String> reps( final Collection<RemoteRepository> repos) { final Collection<String> texts = new ArrayList<String>(repos.size()); final StringBuilder text = new StringBuilder(); for (final RemoteRepository repo : repos) { final Authentication auth = repo.getAuthentication(); text.setLength(0); text.append(repo.toString()); if (auth == null) { text.append(" without authentication"); } else { text.append(" with ").append(auth.toString()); } texts.add(text.toString()); } return texts; }
/** * Capture deployed artifacts remote repo config for later use in uploading the buildinfo for the artifact. */ private void logRepositoryConfiguration(final ArtifactOperationDTO operation, final RepositoryEvent event) { if (event.getRepository() != null) { log.debug("Repo type: {}; info {}", event.getRepository().getClass(), event.getRepository()); } if (ArtifactOperationDTO.DEPLOYED.equals(operation)) { ArtifactRepository repository = event.getRepository(); if (repository instanceof RemoteRepository) { RemoteRepository remoteRepo = (RemoteRepository) repository; log.debug("Deploy info for remote repository: {}", repository); log.debug(" Authentication: {}", remoteRepo.getAuthentication()); } } }
private String getRepoKey( RemoteRepository repository ) { StringBuilder buffer = new StringBuilder( 128 ); Proxy proxy = repository.getProxy(); if ( proxy != null ) { appendAuth( buffer, proxy.getAuthentication() ); buffer.append( proxy.getHost() ).append( ':' ).append( proxy.getPort() ).append( '>' ); } Authentication auth = repository.getAuthentication(); appendAuth( buffer, auth ); buffer.append( repository.getContentType() ).append( '-' ); buffer.append( normalizeRepoUrl( repository.getUrl() ) ); return buffer.toString(); }
/** * Capture deployed artifacts remote repo config for later use in uploading the buildinfo for the artifact. */ private void logRepositoryConfiguration(final ArtifactOperationDTO operation, final RepositoryEvent event) { if (event.getRepository() != null) { log.debug("Repo type: {}; info {}", event.getRepository().getClass(), event.getRepository()); } if (ArtifactOperationDTO.DEPLOYED.equals(operation)) { ArtifactRepository repository = event.getRepository(); if (repository instanceof RemoteRepository) { RemoteRepository remoteRepo = (RemoteRepository) repository; log.debug("Deploy info for remote repository: {}", repository); log.debug(" Authentication: {}", remoteRepo.getAuthentication()); } } }
private String getRepoKey( RemoteRepository repository ) { StringBuilder buffer = new StringBuilder( 128 ); Proxy proxy = repository.getProxy(); if ( proxy != null ) { appendAuth( buffer, proxy.getAuthentication() ); buffer.append( proxy.getHost() ).append( ':' ).append( proxy.getPort() ).append( '>' ); } Authentication auth = repository.getAuthentication(); appendAuth( buffer, auth ); buffer.append( repository.getContentType() ).append( '-' ); buffer.append( normalizeRepoUrl( repository.getUrl() ) ); return buffer.toString(); }
buffer.append( " for " ).append( repository.getUrl() ); Authentication auth = repository.getAuthentication(); if ( auth != null )
buffer.append( " for " ).append( repository.getUrl() ); Authentication auth = repository.getAuthentication(); if ( auth != null )
this.snapshot = remote.getPolicy(true); RepositoryAuthentication auth = null; if (remote.getAuthentication() != null) { auth = new RepositoryAuthentication( remote.getAuthentication() );
/** * Constructor. * @param remote Source of data. */ @SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops") public SimpleRepository(final RemoteRepository remote) { this.identifier = remote.getId(); this.type = remote.getContentType(); this.url = remote.getUrl(); this.release = remote.getPolicy(false); this.snapshot = remote.getPolicy(true); RepositoryAuthentication auth = null; if (remote.getAuthentication() != null) { auth = new RepositoryAuthentication( remote.getAuthentication() ); } this.authentication = auth; RepositoryProxy proxy = null; if (remote.getProxy() != null) { proxy = new RepositoryProxy(remote.getProxy()); } this.repoproxy = proxy; this.manager = remote.isRepositoryManager(); }
private Realm getRealm( RemoteRepository repository, String credentialEncoding ) { Realm realm = null; Authentication a = repository.getAuthentication(); if ( a != null && a.getUsername() != null ) { realm = new Realm.RealmBuilder().setPrincipal( a.getUsername() ).setPassword( a.getPassword() ).setUsePreemptiveAuth( false ).setEnconding( credentialEncoding ).build(); } return realm; }
private Realm getRealm( RemoteRepository repository, String credentialEncoding ) { Realm realm = null; Authentication a = repository.getAuthentication(); if ( a != null && a.getUsername() != null ) { realm = new Realm.RealmBuilder().setPrincipal( a.getUsername() ).setPassword( a.getPassword() ).setUsePreemptiveAuth( false ).setEnconding( credentialEncoding ).build(); } return realm; }
private RemoteRepository getRemoteRepository( RepositorySystemSession session, ArtifactRepository remoteRepository ) throws ArtifactDeployerException { // CHECKSTYLE_OFF: LineLength RemoteRepository aetherRepo = (RemoteRepository) Invoker.invoke( RepositoryUtils.class, "toRepo", org.apache.maven.artifact.repository.ArtifactRepository.class, remoteRepository ); // CHECKSTYLE_ON: LineLength if ( aetherRepo.getAuthentication() == null ) { aetherRepo.setAuthentication( session.getAuthenticationSelector().getAuthentication( aetherRepo ) ); } if ( aetherRepo.getProxy() == null ) { aetherRepo.setProxy( session.getProxySelector().getProxy( aetherRepo ) ); } return aetherRepo; } }
private AuthenticationInfo getAuthenticationInfo( RemoteRepository repository ) { AuthenticationInfo auth = null; Authentication a = repository.getAuthentication(); if ( a != null ) { auth = new AuthenticationInfo(); auth.setUserName( a.getUsername() ); auth.setPassword( a.getPassword() ); auth.setPrivateKey( a.getPrivateKeyFile() ); auth.setPassphrase( a.getPassphrase() ); } return auth; }
merged.setUrl( dominant.getUrl() ); merged.setAuthentication( dominant.getAuthentication() ); merged.setProxy( dominant.getProxy() );
/** * Creates a shallow copy of the specified repository. * * @param repository The repository to copy, must not be {@code null}. */ public RemoteRepository( RemoteRepository repository ) { setId( repository.getId() ); setContentType( repository.getContentType() ); setUrl( repository.getUrl() ); setPolicy( true, repository.getPolicy( true ) ); setPolicy( false, repository.getPolicy( false ) ); setAuthentication( repository.getAuthentication() ); setProxy( repository.getProxy() ); setMirroredRepositories( repository.getMirroredRepositories() ); setRepositoryManager( repository.isRepositoryManager() ); }
/** * Creates a shallow copy of the specified repository. * * @param repository The repository to copy, must not be {@code null}. */ public RemoteRepository( RemoteRepository repository ) { setId( repository.getId() ); setContentType( repository.getContentType() ); setUrl( repository.getUrl() ); setPolicy( true, repository.getPolicy( true ) ); setPolicy( false, repository.getPolicy( false ) ); setAuthentication( repository.getAuthentication() ); setProxy( repository.getProxy() ); setMirroredRepositories( repository.getMirroredRepositories() ); setRepositoryManager( repository.isRepositoryManager() ); }
merged.setUrl( dominant.getUrl() ); merged.setAuthentication( dominant.getAuthentication() ); merged.setProxy( dominant.getProxy() );
/** * Creates a shallow copy of the specified repository. * * @param repository The repository to copy, must not be {@code null}. */ public RemoteRepository( RemoteRepository repository ) { setId( repository.getId() ); setContentType( repository.getContentType() ); setUrl( repository.getUrl() ); setPolicy( true, repository.getPolicy( true ) ); setPolicy( false, repository.getPolicy( false ) ); setAuthentication( repository.getAuthentication() ); setProxy( repository.getProxy() ); setMirroredRepositories( repository.getMirroredRepositories() ); setRepositoryManager( repository.isRepositoryManager() ); }