Package pku.cbi.abcgrid.worker.tar

Examples of pku.cbi.abcgrid.worker.tar.Tar


     * extract .tar.gz file.
     */
    private static void extractTargz(String fname, String targetDir, boolean removeSourceFile)
            throws Exception
    {
        Tar app = new Tar();
        try
        {
            makeDir(targetDir);
            File fsrc = new File(fname);
            app.open(fsrc, "r:gz");
            //String dbname = extractName(fname);
            //String targetDirAndDB  = FilenameUtils.concat(targetDir,dbname);
            //app.extract(targetDirAndDB);
            app.extract(targetDir);
            //for saving the disk space, truncate file size to zero but
            //reserve the "date of last modified" as the tag.
            truncate(fsrc);
            if (removeSourceFile)
                fsrc.delete();
        }
        finally
        {
            app.close();
        }
    }
View Full Code Here

TOP

Related Classes of pku.cbi.abcgrid.worker.tar.Tar

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.