Package org.elasticsearch.common.http.client

Examples of org.elasticsearch.common.http.client.HttpDownloadHelper.download()


                pluginFile = new File(environment.pluginsFile(), name + ".zip");
                if (url != null) {
                    URL pluginUrl = new URL(url);
                    System.out.println("Trying " + pluginUrl.toExternalForm() + "...");
                    try {
                        downloadHelper.download(pluginUrl, pluginFile, new HttpDownloadHelper.VerboseProgress(System.out));
                        downloaded = true;
                    } catch (IOException e) {
                        // ignore
                    }
                } else {
View Full Code Here


                        if (version == null) {
                            // try with ES version from downloads
                            URL pluginUrl = new URL("https://github.com/downloads/" + userName + "/" + repoName + "/" + repoName + "-" + Version.number() + ".zip");
                            System.out.println("Trying " + pluginUrl.toExternalForm() + "...");
                            try {
                                downloadHelper.download(pluginUrl, pluginFile, new HttpDownloadHelper.VerboseProgress(System.out));
                                downloaded = true;
                            } catch (IOException e) {
                                // try a tag with ES version
                                pluginUrl = new URL("https://github.com/" + userName + "/" + repoName + "/zipball/v" + Version.number());
                                System.out.println("Trying " + pluginUrl.toExternalForm() + "...");
View Full Code Here

                            } catch (IOException e) {
                                // try a tag with ES version
                                pluginUrl = new URL("https://github.com/" + userName + "/" + repoName + "/zipball/v" + Version.number());
                                System.out.println("Trying " + pluginUrl.toExternalForm() + "...");
                                try {
                                    downloadHelper.download(pluginUrl, pluginFile, new HttpDownloadHelper.VerboseProgress(System.out));
                                    downloaded = true;
                                } catch (IOException e1) {
                                    // download master
                                    pluginUrl = new URL("https://github.com/" + userName + "/" + repoName + "/zipball/master");
                                    System.out.println("Trying " + pluginUrl.toExternalForm() + "...");
View Full Code Here

                                } catch (IOException e1) {
                                    // download master
                                    pluginUrl = new URL("https://github.com/" + userName + "/" + repoName + "/zipball/master");
                                    System.out.println("Trying " + pluginUrl.toExternalForm() + "...");
                                    try {
                                        downloadHelper.download(pluginUrl, pluginFile, new HttpDownloadHelper.VerboseProgress(System.out));
                                        downloaded = true;
                                    } catch (IOException e2) {
                                        // ignore
                                    }
                                }
View Full Code Here

                        } else {
                            // download explicit version
                            URL pluginUrl = new URL("https://github.com/downloads/" + userName + "/" + repoName + "/" + repoName + "-" + version + ".zip");
                            System.out.println("Trying " + pluginUrl.toExternalForm() + "...");
                            try {
                                downloadHelper.download(pluginUrl, pluginFile, new HttpDownloadHelper.VerboseProgress(System.out));
                                downloaded = true;
                            } catch (IOException e) {
                                // try a tag with ES version
                                pluginUrl = new URL("https://github.com/" + userName + "/" + repoName + "/zipball/v" + version);
                                System.out.println("Trying " + pluginUrl.toExternalForm() + "...");
View Full Code Here

                            } catch (IOException e) {
                                // try a tag with ES version
                                pluginUrl = new URL("https://github.com/" + userName + "/" + repoName + "/zipball/v" + version);
                                System.out.println("Trying " + pluginUrl.toExternalForm() + "...");
                                try {
                                    downloadHelper.download(pluginUrl, pluginFile, new HttpDownloadHelper.VerboseProgress(System.out));
                                    downloaded = true;
                                } catch (IOException e1) {
                                    // ignore
                                }
                            }
View Full Code Here

                        }
                    } else {
                        URL pluginUrl = new URL(url + "/" + name + "/elasticsearch-" + name + "-" + Version.number() + ".zip");
                        System.out.println("Trying " + pluginUrl.toExternalForm() + "...");
                        try {
                            downloadHelper.download(pluginUrl, pluginFile, new HttpDownloadHelper.VerboseProgress(System.out));
                            downloaded = true;
                        } catch (IOException e) {
                            // ignore
                        }
                    }
View Full Code Here

        // first, try directly from the URL provided
        if (url != null) {
            URL pluginUrl = new URL(url);
            log("Trying " + pluginUrl.toExternalForm() + "...");
            try {
                downloadHelper.download(pluginUrl, pluginFile, progress, this.timeout);
                downloaded = true;
            } catch (ElasticsearchTimeoutException e) {
                throw e;
            } catch (Exception e) {
                // ignore
View Full Code Here

        if (!downloaded) {
            // We try all possible locations
            for (URL url : pluginHandle.urls()) {
                log("Trying " + url.toExternalForm() + "...");
                try {
                    downloadHelper.download(url, pluginFile, progress, this.timeout);
                    downloaded = true;
                    break;
                } catch (ElasticsearchTimeoutException e) {
                    throw e;
                } catch (Exception e) {
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.