package com.hgq;

import com.hgq.util.RarUtil;
import com.hgq.util.ZipUtil;

import java.io.File;
import java.io.IOException;

/**
 * TODO 类的作用信息
 *
 * @author huguangquan
 * @date 22-9-16 016
 */
public class Test {
    public static void main(String[] args) {
        // 压缩文件存放目录
        String compressPath = "D:\\compress_file\\";
        // 解压缩文件存放目录
        String decompressPath = "D:\\decompress_file\\";

        //unzip(compressPath, decompressPath);

        unrar(compressPath, decompressPath);
    }

    private static void unzip(String compressPath, String decompressPath) {
        String zipFile = compressPath + "\\" + "test.zip";
        try {
            ZipUtil.unZip(new File(zipFile), decompressPath);
            System.out.println("zip文件解压缩完成");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private static void unrar(String compressPath, String decompressPath) {
        String rarFile = compressPath + "\\" + "ma1.rar";
        // 测试Rar5版本压缩文件
        RarUtil.unRar(rarFile, decompressPath);
        System.out.println("rar 文件解压缩完成");
    }
}
最近下载更多
Seaskye  LV14 2023年11月10日
小幸运xiao  LV1 2023年11月3日
逐风796  LV2 2023年8月17日
wangguojie  LV1 2023年5月16日
最代码官方  LV167 2022年9月18日
最近浏览更多
cnng007 2023年11月21日
暂无贡献等级
Seaskye  LV14 2023年11月10日
小幸运xiao  LV1 2023年11月3日
graceful 2023年10月18日
暂无贡献等级
我是恁爹记住 2023年9月27日
暂无贡献等级
二进制2  LV3 2023年9月12日
逐风796  LV2 2023年8月17日
zw5097  LV23 2023年7月15日
sanye333  LV1 2023年6月13日
wangguojie  LV1 2023年5月16日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友