use of aQute.maven.api.Archive in project bnd by bndtools.
the class Releaser method uploadAll.
void uploadAll(Iterator<Archive> iterator) throws Exception {
if (!iterator.hasNext())
return;
Archive archive = iterator.next();
File f = home.toLocalFile(archive);
try {
repo.store(f, archive.remotePath);
sign(archive, f);
uploadAll(iterator);
} catch (Exception e) {
try {
repo.delete(archive.remotePath);
} catch (Exception ee) {
// original
throw e;
}
}
}
use of aQute.maven.api.Archive in project bnd by bndtools.
the class Releaser method add.
@Override
public void add(String extension, String classifier, InputStream in) throws Exception {
Archive a = revision.archive(extension, classifier);
add(a, in);
}
use of aQute.maven.api.Archive in project bnd by bndtools.
the class MavenBackingRepository method getSnapshotArchives.
public List<Archive> getSnapshotArchives(Revision revision) throws Exception {
RevisionMetadata metadata = getMetadata(revision);
List<Archive> archives = new ArrayList<>();
for (SnapshotVersion snapshotVersion : metadata.snapshotVersions) {
Archive archive = revision.archive(snapshotVersion.value, snapshotVersion.extension, snapshotVersion.classifier);
archives.add(archive);
}
return archives;
}
use of aQute.maven.api.Archive in project bnd by bndtools.
the class MavenBndRepository method doSearchMaven.
boolean doSearchMaven(URI uri) throws UnsupportedEncodingException, Exception {
Map<String, String> map = getMapFromQuery(uri);
String filePath = map.get("filepath");
if (filePath != null) {
Archive archive = Archive.fromFilepath(filePath);
if (archive != null) {
if (archive.extension.equals("pom"))
archive = archive.revision.archive("jar", null);
index.add(archive);
return true;
}
}
return false;
}
use of aQute.maven.api.Archive in project bnd by bndtools.
the class MavenRepository method getPomPromise.
private Promise<POM> getPomPromise(final Revision revision) throws Exception {
Deferred<POM> deferred;
synchronized (poms) {
Promise<POM> promise = poms.get(revision);
if (promise != null) {
return promise;
}
deferred = new Deferred<>();
poms.put(revision, deferred.getPromise());
}
Archive pomArchive = revision.getPomArchive();
deferred.resolveWith(get(pomArchive, false).map(new Function<File, POM>() {
@Override
public POM apply(File pomFile) {
if (pomFile == null) {
return null;
}
try (InputStream fin = IO.stream(pomFile)) {
return getPom(fin);
} catch (Exception e) {
logger.error("Failed to parse pom {} from file {}", revision, pomFile, e);
return null;
}
}
}));
return deferred.getPromise();
}
Aggregations