/** * Checks the URL to see if this repository refers to an external repository. * * @param repository The repository to check, must not be {@code null}. * @return {@code true} if external, {@code false} otherwise. */ static boolean isExternalRepo( RemoteRepository repository ) { boolean local = "localhost".equals( repository.getHost() ) || "127.0.0.1".equals( repository.getHost() ) || "file".equalsIgnoreCase( repository.getProtocol() ); return !local; }
private boolean isOfflineHost( RepositorySystemSession session, RemoteRepository repository ) { String[] hosts = getConfig( session, CONFIG_PROP_OFFLINE_HOSTS ); if ( hosts != null ) { String host = repository.getHost(); if ( host.length() > 0 ) { for ( String h : hosts ) { if ( h.equalsIgnoreCase( host ) ) { return true; } } } } return false; }
private boolean isOfflineHost( RepositorySystemSession session, RemoteRepository repository ) { String[] hosts = getConfig( session, CONFIG_PROP_OFFLINE_HOSTS ); if ( hosts != null ) { String host = repository.getHost(); if ( host.length() > 0 ) { for ( String h : hosts ) { if ( h.equalsIgnoreCase( host ) ) { return true; } } } } return false; }
@Override public Proxy getProxy(RemoteRepository repo) { Proxy ret = null; if (proxy.getType().equals(repo.getProtocol())) { boolean match = false; for (Pattern p : nonProxyHosts) { if (p.matcher(repo.getHost()).matches()) { match = true; break; } } if (!match) { ret = proxy; } } return ret; } }
private Executor getExecutor( Collection<?> artifacts, Collection<?> metadatas ) { if ( maxThreads <= 1 ) { return DirectExecutor.INSTANCE; } int tasks = safe( artifacts ).size() + safe( metadatas ).size(); if ( tasks <= 1 ) { return DirectExecutor.INSTANCE; } if ( executor == null ) { executor = new ThreadPoolExecutor( maxThreads, maxThreads, 3L, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new WorkerThreadFactory( getClass().getSimpleName() + '-' + repository.getHost() + '-' ) ); } return executor; }
private Executor getExecutor( Collection<?> artifacts, Collection<?> metadatas ) { if ( maxThreads <= 1 ) { return DirectExecutor.INSTANCE; } int tasks = safe( artifacts ).size() + safe( metadatas ).size(); if ( tasks <= 1 ) { return DirectExecutor.INSTANCE; } if ( executor == null ) { executor = new ThreadPoolExecutor( maxThreads, maxThreads, 3, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new WorkerThreadFactory( getClass().getSimpleName() + '-' + repository.getHost() + '-' ) ); } return executor; }
String host = repository.getHost(); for ( ProxyDef proxy : proxies )
String host = repository.getHost(); for ( ProxyDef proxy : proxies )