use of aQute.p2.api.P2Index in project bnd by bndtools.
the class P2Impl method parseIndexArtifacts.
private Promise<List<Artifact>> parseIndexArtifacts(Set<URI> cycles, URI uri, File file) throws Exception {
P2Index index;
if (file == null) {
index = getDefaultIndex(uri);
} else {
index = parseIndex(file, uri);
}
canonicalize(index.artifacts);
canonicalize(index.content);
return getArtifacts(cycles, index.artifacts);
}
use of aQute.p2.api.P2Index in project bnd by bndtools.
the class P2Impl method parseIndex.
private P2Index parseIndex(File file, URI base) throws IOException {
Properties p = new Properties();
try (InputStream in = IO.stream(file)) {
p.load(in);
}
String version = p.getProperty("version");
if (version == null || Integer.parseInt(version) != 1)
throw new UnsupportedOperationException("The repository " + base + " specifies an index file with an incompatible version " + version);
P2Index index = new P2Index();
addPaths(p.getProperty("metadata.repository.factory.order"), index.content, base);
addPaths(p.getProperty("artifact.repository.factory.order"), index.artifacts, base);
index.modified = file.lastModified();
return index;
}
use of aQute.p2.api.P2Index in project bnd by bndtools.
the class P2Impl method getDefaultIndex.
private P2Index getDefaultIndex(URI base) {
P2Index index = new P2Index();
index.artifacts.add(base.resolve("compositeArtifacts.xml"));
index.artifacts.add(base.resolve("artifacts.xml"));
index.content.add(base.resolve("compositeContent.xml"));
index.content.add(base.resolve("content.xml"));
defaults.addAll(index.artifacts);
defaults.addAll(index.content);
return index;
}
Aggregations