Package io.fabric8.agent.download

Examples of io.fabric8.agent.download.DownloadManager.download()


        Map<URI, Repository> repositories = new HashMap<URI, Repository>();
        AgentUtils.addRepository(manager, repositories, URI.create("mvn:org.apache.karaf.assemblies.features/standard/" + System.getProperty("karaf-version") + "/xml/features"));

        DeploymentBuilder builder = new DeploymentBuilder(manager, null, repositories.values(), 0);

        builder.download(new HashSet<String>(Arrays.asList("karaf-framework", "ssh")),
                         Collections.<String>emptySet(),
                         Collections.<String>emptySet(),
                         Collections.<String>emptySet(),
                         Collections.<String>emptySet(),
                         Collections.<String>emptySet(),
View Full Code Here


                    manager,
                    null,
                    repositories.values(),
                    -1 // Disable url handlers
            );
            Map<String, Resource> downloadedResources = builder.download(
                    getPrefixedProperties(properties, "feature."),
                    getPrefixedProperties(properties, "bundle."),
                    getPrefixedProperties(properties, "fab."),
                    getPrefixedProperties(properties, "req."),
                    getPrefixedProperties(properties, "override."),
View Full Code Here

            if (container != null) {
                final DownloadManager downloadManager = DownloadManagers.createDownloadManager(fabricService, downloadExecutor);
                return new DownloadStrategy() {
                    @Override
                    public File downloadContent(URL sourceUrl, File installDir) throws IOException {
                        DownloadFuture future = downloadManager.download(sourceUrl.toString());
                        File file = AgentUtils.waitForFileDownload(future);
                        if (file != null && file.exists() && file.isFile()) {
                            // now lest copy it to the install dir
                            File newFile = new File(installDir, file.getName());
                            Files.copy(file, newFile);
View Full Code Here

        String settings = createMavenSettingsWithProxy(server.getConnectors()[0].getLocalPort());
        DownloadManager dm = createDownloadManager("http://relevant.not/maven2@id=central", settings, custom);

        try {
            final CountDownLatch latch = new CountDownLatch(1);
            DownloadFuture df = dm.download("mvn:x.y/z/1.0");
            df.addListener(new FutureListener<DownloadFuture>() {
                @Override
                public void operationComplete(DownloadFuture future) {
                    latch.countDown();
                }
View Full Code Here

        String settings = createMavenSettingsWithProxy(server.getConnectors()[0].getLocalPort());
        DownloadManager dm = createDownloadManager("http://relevant.not/maven2@id=central", settings, custom);

        try {
            final CountDownLatch latch = new CountDownLatch(1);
            DownloadFuture df = dm.download("mvn:x.y/z/1.0");
            df.addListener(new FutureListener<DownloadFuture>() {
                @Override
                public void operationComplete(DownloadFuture future) {
                    latch.countDown();
                }
View Full Code Here

        FileOutputStream artifact = new FileOutputStream(new File(dir, "z-1.0.jar"));
        artifact.write(new byte[] { 0x42 });
        artifact.close();

        final CountDownLatch latch = new CountDownLatch(1);
        DownloadFuture df = dm.download("mvn:x.y/z/1.0");
        df.addListener(new FutureListener<DownloadFuture>() {
            @Override
            public void operationComplete(DownloadFuture future) {
                latch.countDown();
            }
View Full Code Here

        MavenConfigurationImpl config = new MavenConfigurationImpl(new PropertiesPropertyResolver(System.getProperties()), "org.ops4j.pax.url.mvn");
        config.setSettings(new MavenSettingsImpl(config.getSettingsFileUrl(), config.useFallbackRepositories()));
        DownloadManager dm = new DownloadManager(config, Executors.newSingleThreadExecutor());

        final CountDownLatch latch = new CountDownLatch(1);
        final DownloadFuture df = dm.download(String.format("mvn:%s/%s/%s", archetype.groupId, archetype.artifactId, archetype.version));
        df.addListener(new FutureListener<DownloadFuture>() {
            @Override
            public void operationComplete(DownloadFuture future) {
                latch.countDown();
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.