aQute.maven.nexus.provider.Nexus Maven / Gradle / Ivy
package aQute.maven.nexus.provider;
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Formatter;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.osgi.dto.DTO;
import org.osgi.util.promise.Deferred;
import org.osgi.util.promise.Promise;
import org.osgi.util.promise.Promises;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import aQute.bnd.http.HttpClient;
import aQute.bnd.http.HttpRequest;
import aQute.bnd.service.url.TaggedData;
import aQute.lib.exceptions.Exceptions;
import aQute.libg.glob.Glob;
public class Nexus {
final static String MAVEN_INDEX_S = "href\\s*=\\s*([\"'])(?[^\\./][^\"'\r\n]+)\\1";
final static Pattern MAVEN_INDEX_P = Pattern.compile(MAVEN_INDEX_S);
static Logger logger = LoggerFactory.getLogger(Nexus.class);
private URI uri;
private HttpClient client;
private Executor executor;
public static class Asset extends DTO {
public URI downloadUrl;
public String path;
public String id;
public String repository;
public String format;
public Map checksum;
}
public static class Assets extends DTO {
public List items;
public String continuationToken;
}
@Deprecated
public Nexus(URI uri, HttpClient client) throws URISyntaxException {
this(uri, client, null);
}
public Nexus(URI uri, HttpClient client, Executor executor) throws URISyntaxException {
this.executor = executor;
this.uri = uri.toString()
.endsWith("/") ? uri : new URI(uri.toString() + "/");
this.client = client;
}
public HttpRequest
© 2015 - 2024 Weber Informatics LLC | Privacy Policy