@Override public void upload(String groupId, String artifactId, String classifier, String extension, String version, File artifact) throws IOException { fallback.upload(groupId, artifactId, classifier, extension, version, artifact); }
@Override public File resolveMetadata(String groupId, String artifactId, String type, String version, Exception previousException) throws IOException { return fallback.resolveMetadata(groupId, artifactId, type, version, previousException); }
@Override public RetryChance isRetryableException(Exception exception) { return fallback.isRetryableException(exception); }
@Override public URLConnection openConnection(URL url) throws IOException { MavenResolver resolver = MavenResolvers.createMavenResolver(null, ServiceConstants.PID); Connection conn = new Connection(url, resolver); conn.setUseCaches(false);// to avoid concurent thread to have an IllegalStateException. return conn; }
@Override protected File download(Exception previousException) throws Exception { return resolver.resolve(url, previousException); }
@Override public URLStreamHandler createURLStreamHandler(String protocol) { if (protocol.equals("mvn")) { return new org.ops4j.pax.url.mvn.Handler(); } return null; } };
@Override public void uploadMetadata(String groupId, String artifactId, String type, String version, File artifact) throws IOException { fallback.uploadMetadata(groupId, artifactId, type, version, artifact); }
@Override public void close() throws IOException { fallback.close(); }
@Override public File resolve(String url) throws IOException { Artifact artifact = toArtifact(url); File file = reactor.findArtifact(artifact); return file == null ? fallback.resolve(url) : file; }
@Override public URLStreamHandler createURLStreamHandler(final String protocol) { if ("mvn".equals(protocol)) { return new org.ops4j.pax.url.mvn.Handler(); } return null; } });
@Override public RetryChance isRetryableException(Exception exception) { return fallback.isRetryableException(exception); }
@Override public void upload(String groupId, String artifactId, String classifier, String extension, String version, File artifact) throws IOException { fallback.upload(groupId, artifactId, classifier, extension, version, artifact); }
@Override public File resolveMetadata(String groupId, String artifactId, String type, String version) throws IOException { return fallback.resolveMetadata(groupId, artifactId, type, version); }
@Override public void uploadMetadata(String groupId, String artifactId, String type, String version, File artifact) throws IOException { fallback.uploadMetadata(groupId, artifactId, type, version, artifact); }
@Override public void close() throws IOException { fallback.close(); }
@Override public URLStreamHandler createURLStreamHandler(String protocol) { if (ServiceConstants.PROTOCOL.equals(protocol)) { return new Handler(); } else { return null; } } });
/** * Maven artifact may be looked up in several repositories. Only if exception for <strong>each</strong> * repository is not retryable, we won't retry. * @param e * @return */ @Override protected Retry isRetryable(IOException e) { // convert pax-url-aether "retry" to features.core "retry" concept switch (resolver.isRetryableException(e)) { case NEVER: return Retry.NO_RETRY; case LOW: case HIGH: // no need to repeat many times return Retry.QUICK_RETRY; case UNKNOWN: default: return Retry.DEFAULT_RETRY; } }
@Override public File resolveMetadata(String groupId, String artifactId, String type, String version) throws IOException { return fallback.resolveMetadata(groupId, artifactId, type, version); }
@Override public URLStreamHandler createURLStreamHandler(String protocol) { if (ServiceConstants.PROTOCOL.equals(protocol)) { return new Handler(); } else { return null; } } });
@Override public File resolveMetadata(String groupId, String artifactId, String type, String version, Exception previousException) throws IOException { return fallback.resolveMetadata(groupId, artifactId, type, version, previousException); }