Package org.csm.jupdater.logic

Examples of org.csm.jupdater.logic.Update


* @author Santiago Moreno <ingcsmoreno@gmail.com>
*/
public class DownloadManager {

    public static void downloadUpdate(int updateCode) throws ChecksumFailException, IOException {
        Update update = UpdateManager.getUpdate(updateCode);;
        try {
            String updateChecksum = downloadFile(update.getUpdateFile());
            Logger.getLogger(DownloadManager.class.getName()).debug("Checksum="
                    +updateChecksum);
            if (updateChecksum.compareTo(update.getChecksum())!=0)
                throw new ChecksumFailException("Downloaded file "
                        + update.getUpdateFile() + " checksum fails.");
        } catch (MalformedURLException ex) {
            Logger.getLogger(DownloadManager.class.getName()).error(
                    "URL: "+update.getUpdateFile()+"\n"+ex.getStackTrace());
        }
    }
View Full Code Here


        }
        return untarResutl;
    }

    public static void uncompressUpdate(int updateCode) throws FileNotFoundException {
        Update update = UpdateManager.getUpdate(updateCode);

        String fileName = DownloadManager.getFileName(
                update.getUpdateFile());

        String destinationFolder = ConfigurationManager.getProperty("INSTALL_PATH");

        untarUpdate(fileName, destinationFolder);
    }
View Full Code Here

TOP

Related Classes of org.csm.jupdater.logic.Update

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.