Package com.alimama.mdrill.utils.zip

Examples of com.alimama.mdrill.utils.zip.ZipOutputStream$UnicodeExtraFieldPolicy


     * @throws Exception
     */
    public static void zip(FileSystem fs,String sourceFolder1, FileSystem fs2,String zipFilePath2) throws Exception {
        OutputStream out = fs2.create(new Path(zipFilePath2),true);
        BufferedOutputStream bos = new BufferedOutputStream(out);
        ZipOutputStream zos = new ZipOutputStream(bos);
        // 解决中文文件名乱码
        zos.setEncoding(CHINESE_CHARSET);
        Path basePath = null;
        Path src=new Path(sourceFolder1);
        FileStatus f=fs.getFileStatus(src);
        if (f.isDir()) {
            basePath =f.getPath();
        } else {
            basePath = f.getPath().getParent();
        }
        zipFile(fs,f, basePath, zos);
        zos.closeEntry();
        zos.close();
        bos.close();
        out.close();
    }
View Full Code Here

TOP

Related Classes of com.alimama.mdrill.utils.zip.ZipOutputStream$UnicodeExtraFieldPolicy

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.