@Override public String toString() { return getHost() + ':' + getPort(); }
@Override public String toString() { return getHost() + ':' + getPort(); }
@Override public String toString() { return getHost() + ':' + getPort(); }
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(); }
if ( proxy != null ) buffer.append( " via " ).append( proxy.getHost() ).append( ':' ).append( proxy.getPort() );
if ( proxy != null ) buffer.append( " via " ).append( proxy.getHost() ).append( ':' ).append( proxy.getPort() );
/** * Creates a new proxy with the specified properties. * @param proxy The proxy object. */ public RepositoryProxy(final Proxy proxy) { this.type = proxy.getType(); this.host = proxy.getHost(); this.port = proxy.getPort(); this.auth = new RepositoryAuthentication(proxy.getAuthentication()); }
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 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; }