Search in sources :

Example 1 with P2Index

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);
}
Also used : P2Index(aQute.p2.api.P2Index)

Example 2 with P2Index

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;
}
Also used : FilterInputStream(java.io.FilterInputStream) XZInputStream(org.tukaani.xz.XZInputStream) InputStream(java.io.InputStream) Properties(java.util.Properties) P2Index(aQute.p2.api.P2Index)

Example 3 with P2Index

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;
}
Also used : P2Index(aQute.p2.api.P2Index)

Aggregations

P2Index (aQute.p2.api.P2Index)3 FilterInputStream (java.io.FilterInputStream)1 InputStream (java.io.InputStream)1 Properties (java.util.Properties)1 XZInputStream (org.tukaani.xz.XZInputStream)1