Package sagan.tools.support

Source Code of sagan.tools.support.DownloadLinkExtractor

package sagan.tools.support;

import sagan.tools.DownloadLink;
import sagan.tools.FileDownload;

class DownloadLinkExtractor {
    public DownloadLink createDownloadLink(FileDownload download) {
        String url = download.getBucket() + download.getFile();
        String fileType;
        if (download.getFile().endsWith(".tar.gz")) {
            fileType = "tar.gz";
        } else {
            fileType = download.getFile().substring(download.getFile().lastIndexOf(".") + 1);
        }
        String architecture = download.getDescription().indexOf("64bit") != -1 ? "64" : "32";
        return new DownloadLink(url, fileType, download.getSize(), download.getOs(), architecture);
    }
}
TOP

Related Classes of sagan.tools.support.DownloadLinkExtractor

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.