Package com.atlauncher.data

Examples of com.atlauncher.data.Downloadable.download()


        File configs = new File(App.settings.getTempDir(), "Configs.zip");
        String path = "packs/" + pack.getSafeName() + "/versions/" + version.getVersion() + "/Configs.zip";
        Downloadable configsDownload = new Downloadable(path, configs, null, this, true);
        this.totalBytes = configsDownload.getFilesize();
        this.downloadedBytes = 0;
        configsDownload.download(true); // Download the file

        // Extract the configs zip file
        fireSubProgressUnknown();
        fireTask(Language.INSTANCE.localize("instance.extractingconfigs"));
        Utils.unzip(configs, getRootDirectory());
View Full Code Here


                break;
            case direct:
                Downloadable download1 = new Downloadable(this.getUrl(), fileLocation, this.md5, installer, false);
                if (download1.needToDownload()) {
                    installer.resetDownloadedBytes(download1.getFilesize());
                    download1.download(true);
                }
                break;
            case server:
                Downloadable download2 = new Downloadable(this.getUrl(), fileLocation, this.md5, installer, true);
                if (download2.needToDownload()) {
View Full Code Here

                }
                break;
            case server:
                Downloadable download2 = new Downloadable(this.getUrl(), fileLocation, this.md5, installer, true);
                if (download2.needToDownload()) {
                    download2.download(false);
                }
                break;
        }
        if (hasMD5()) {
            if (Utils.getMD5(fileLocation).equalsIgnoreCase(this.md5)) {
View Full Code Here

                }
            }
        } else if (this.serverDownload == DownloadType.direct) {
            Downloadable download = new Downloadable(this.serverUrl, fileLocation, this.serverMD5, installer, false);
            if (download.needToDownload()) {
                download.download(false);
            }
        } else if (this.serverDownload == DownloadType.server) {
            Downloadable download = new Downloadable(this.serverUrl, fileLocation, this.serverMD5, installer, true);
            if (download.needToDownload()) {
                download.download(false);
View Full Code Here

                download.download(false);
            }
        } else if (this.serverDownload == DownloadType.server) {
            Downloadable download = new Downloadable(this.serverUrl, fileLocation, this.serverMD5, installer, true);
            if (download.needToDownload()) {
                download.download(false);
            }
        }
        if (hasServerMD5()) {
            if (Utils.getMD5(fileLocation).equalsIgnoreCase(this.serverMD5)) {
                return; // MD5 hash matches
View Full Code Here

                            Utils.delete(file);
                        }
                        long started = System.currentTimeMillis();

                        Downloadable download = new Downloadable(server.getFileURL("20MB.test"), file);
                        download.download(false);

                        long timeTaken = System.currentTimeMillis() - started;
                        float bps = file.length() / (timeTaken / 1000);
                        float kbps = bps / 1024;
                        float mbps = kbps / 1024;
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.