public Proxy getProxy( RemoteRepository repository ) { return repository.getProxy(); }
public Proxy getProxy( RemoteRepository repository ) { Proxy proxy = repository.getProxy(); if ( proxy != null ) { return proxy; } return selector.getProxy( repository ); }
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(); }
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(); }
Proxy proxy = repository.getProxy(); if ( proxy != null )
Proxy proxy = repository.getProxy(); if ( proxy != null )
/** * 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 ProxyServer getProxy( RemoteRepository repository, String credentialEncoding ) { ProxyServer proxyServer = null; Proxy p = repository.getProxy(); if ( p != null ) { Authentication a = p.getAuthentication(); boolean useSSL = repository.getProtocol().equalsIgnoreCase( "https" ) || repository.getProtocol().equalsIgnoreCase( "dav:https" ); if ( a == null ) { proxyServer = new ProxyServer( useSSL ? Protocol.HTTPS : Protocol.HTTP, p.getHost(), p.getPort() ); } else { proxyServer = new ProxyServer( useSSL ? Protocol.HTTPS : Protocol.HTTP, p.getHost(), p.getPort(), a.getUsername(), a.getPassword() ); proxyServer.setEncoding( credentialEncoding ); } } return proxyServer; }
private ProxyServer getProxy( RemoteRepository repository, String credentialEncoding ) { ProxyServer proxyServer = null; Proxy p = repository.getProxy(); if ( p != null ) { Authentication a = p.getAuthentication(); boolean useSSL = repository.getProtocol().equalsIgnoreCase( "https" ) || repository.getProtocol().equalsIgnoreCase( "dav:https" ); if ( a == null ) { proxyServer = new ProxyServer( useSSL ? Protocol.HTTPS : Protocol.HTTP, p.getHost(), p.getPort() ); } else { proxyServer = new ProxyServer( useSSL ? Protocol.HTTPS : Protocol.HTTP, p.getHost(), p.getPort(), a.getUsername(), a.getPassword() ); proxyServer.setEncoding( credentialEncoding ); } } return proxyServer; }
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 ProxyInfoProvider getProxy( RemoteRepository repository ) { ProxyInfoProvider proxy = null; Proxy p = repository.getProxy(); if ( p != null ) { final ProxyInfo prox = new ProxyInfo(); prox.setType( p.getType() ); prox.setHost( p.getHost() ); prox.setPort( p.getPort() ); if ( p.getAuthentication() != null ) { prox.setUserName( p.getAuthentication().getUsername() ); prox.setPassword( p.getAuthentication().getPassword() ); } proxy = new ProxyInfoProvider() { public ProxyInfo getProxyInfo( String protocol ) { return prox; } }; } return proxy; }
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.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() ); }