Package org.apache.ivy.osgi.p2

Examples of org.apache.ivy.osgi.p2.P2ArtifactParser


    private boolean readArtifacts(URI repoUri, P2Descriptor p2Descriptor) throws IOException,
            ParseException, SAXException {
        boolean artifactExists = readCompositeArtifact(repoUri, "compositeArtifacts", p2Descriptor);
        if (!artifactExists) {
            artifactExists = readJarOrXml(repoUri, "artifacts", new P2ArtifactParser(p2Descriptor,
                    repoUri.toURL().toExternalForm()));
        }

        return artifactExists;
    }
View Full Code Here


            throws IOException, ParseException, SAXException {
        Message.verbose("Loading P2 repository " + repoUri);

        boolean artifactExists = readComposite(repoUri, "compositeArtifacts", p2Descriptor);
        if (!artifactExists) {
            artifactExists = readJarOrXml(repoUri, "artifacts", new P2ArtifactParser(p2Descriptor,
                    repoUri.toURL().toExternalForm()));
        }

        boolean contentExists = readComposite(repoUri, "compositeContent", p2Descriptor);
        if (!contentExists) {
View Full Code Here

        return artifactExists;
    }

    private boolean readCompositeContent(URI repoUri, String name, P2Descriptor p2Descriptor)
            throws IOException, ParseException, SAXException {
        P2CompositeParser p2CompositeParser = new P2CompositeParser();
        boolean exist = readJarOrXml(repoUri, name, p2CompositeParser);
        if (exist) {
            for (String childLocation : p2CompositeParser.getChildLocations()) {
                if (!childLocation.endsWith("/")) {
                    childLocation += "/";
                }
                URI childUri = repoUri.resolve(childLocation);
                readContent(childUri, p2Descriptor);
View Full Code Here

        return exist;
    }

    private boolean readCompositeArtifact(URI repoUri, String name, P2Descriptor p2Descriptor)
            throws IOException, ParseException, SAXException {
        P2CompositeParser p2CompositeParser = new P2CompositeParser();
        boolean exist = readJarOrXml(repoUri, name, p2CompositeParser);
        if (exist) {
            for (String childLocation : p2CompositeParser.getChildLocations()) {
                if (!childLocation.endsWith("/")) {
                    childLocation += "/";
                }
                URI childUri = repoUri.resolve(childLocation);
                readArtifacts(childUri, p2Descriptor);
View Full Code Here

        return artifactExists || contentExists;
    }

    private boolean readComposite(URI repoUri, String name, P2Descriptor p2Descriptor)
            throws IOException, ParseException, SAXException {
        P2CompositeParser p2CompositeParser = new P2CompositeParser();
        boolean exist = readJarOrXml(repoUri, name, p2CompositeParser);
        if (exist) {
            Iterator itChildLocation = p2CompositeParser.getChildLocations().iterator();
            while (itChildLocation.hasNext()) {
                String childLocation = (String) itChildLocation.next();
                if (!childLocation.endsWith("/")) {
                    childLocation += "/";
                }
View Full Code Here

        }
        return loadFromSite(site);
    }

    private P2Descriptor loadP2(URI repoUri) throws IOException, ParseException, SAXException {
        P2Descriptor p2Descriptor = new P2Descriptor(repoUri,
                ExecutionEnvironmentProfileProvider.getInstance());
        p2Descriptor.setLogLevel(logLevel);
        if (!populateP2Descriptor(repoUri, p2Descriptor)) {
            return null;
        }
        p2Descriptor.finish();
        return p2Descriptor;
    }
View Full Code Here

        }
        return loadFromSite(site);
    }

    private P2Descriptor loadP2(URI repoUri) throws IOException, ParseException, SAXException {
        P2Descriptor p2Descriptor = new P2Descriptor(repoUri,
                ExecutionEnvironmentProfileProvider.getInstance());
        if (!populateP2Descriptor(repoUri, p2Descriptor)) {
            return null;
        }
        return p2Descriptor;
View Full Code Here

    private boolean readContent(URI repoUri, P2Descriptor p2Descriptor) throws IOException,
            ParseException, SAXException {
        boolean contentExists = readCompositeContent(repoUri, "compositeContent", p2Descriptor);
        if (!contentExists) {
            P2MetadataParser metadataParser = new P2MetadataParser(p2Descriptor);
            metadataParser.setLogLevel(logLevel);
            contentExists = readJarOrXml(repoUri, "content", metadataParser);
        }
        return contentExists;
    }
View Full Code Here

                    repoUri.toURL().toExternalForm()));
        }

        boolean contentExists = readComposite(repoUri, "compositeContent", p2Descriptor);
        if (!contentExists) {
            contentExists = readJarOrXml(repoUri, "content", new P2MetadataParser(p2Descriptor));
        }

        return artifactExists || contentExists;
    }
View Full Code Here

        private Map<String, String> properties;

        public ArtifactHandler() {
            super(ARTIFACT);
            addChild(new PropertiesHandler(), new ChildElementHandler<PropertiesHandler>() {
                public void childHanlded(PropertiesHandler child) {
                    properties = child.properties;
                }
            });
        }
View Full Code Here

TOP

Related Classes of org.apache.ivy.osgi.p2.P2ArtifactParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.