Package com.alimama.mdrill.utils.zip

Examples of com.alimama.mdrill.utils.zip.ZipEntry


        BufferedInputStream bis;
        byte[] cache = new byte[CACHE_SIZE];
        for (FileStatus file : files) {
            if (file.isDir()) {
                pathName = file.getPath().toString().substring(basePath.toString().length() + 1) + "/";
                zos.putNextEntry(new ZipEntry(pathName));
                zipFile(fs,file, basePath, zos);
            } else {
                pathName = file.getPath().toString().substring(basePath.toString().length() + 1);
                is = fs.open(file.getPath());
                bis = new BufferedInputStream(is);
                zos.putNextEntry(new ZipEntry(pathName));
                int nRead = 0;
                while ((nRead = bis.read(cache, 0, CACHE_SIZE)) != -1) {
                    zos.write(cache, 0, nRead);
                }
                bis.close();
View Full Code Here


        Enumeration<?> emu = zipFile.getEntries();
        BufferedInputStream bis;
        FSDataOutputStream fos;
        BufferedOutputStream bos;
        Path file, parentFile;
        ZipEntry entry;
        byte[] cache = new byte[CACHE_SIZE];
        while (emu.hasMoreElements()) {
            entry = (ZipEntry) emu.nextElement();
            if (entry.isDirectory()) {
              fs2.mkdirs(new Path(destDir , entry.getName()));
                continue;
            }
            bis = new BufferedInputStream(zipFile.getInputStream(entry));
            file = new Path(destDir , entry.getName());
            parentFile = file.getParent();
            if (parentFile != null && (!fs2.exists(parentFile))) {
              fs2.mkdirs(parentFile);
            }
            fos =fs2.create(file,true);
View Full Code Here

TOP

Related Classes of com.alimama.mdrill.utils.zip.ZipEntry

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.