java 本地压缩zip包并且下载 两个功能

//生成zip
    public boolean createCardImgZip(String sourcePath, String zipName) {  
    // TODO Auto-generated method stub  
    boolean result = false;  
    String zipPath = "D:/test/";  
    File sourceFile = new File(sourcePath);  
    FileInputStream fis = null;  
    BufferedInputStream bis = null;  
    FileOutputStream fos = null;  
    ZipOutputStream zos = null;  

    if (sourceFile.exists() == false) {  
        System.out.println("File catalog:" + sourcePath + "not exist!");  
    } else {  
        try {  
            if(!new File(zipPath).exists()){  
                new File(zipPath).mkdirs();  
            }  
            File zipFile = new File(zipPath + "/" + zipName + ".zip");  
            if (zipFile.exists()) {  
                System.out.println(zipPath + "Catalog File: " + zipName + ".zip" + "pack file.");  
    
上一篇:Airtest API精讲之断言


下一篇:C# 文件夹操作