程序包 com.sh.util

类 ZipUtil

java.lang.Object
com.sh.util.ZipUtil

public class ZipUtil extends Object
Description: ZIP压缩包工具类 Title:首亨软件 - CRM、TSS、ERP等信息化管理软件
  • 构造器详细资料

    • ZipUtil

      public ZipUtil()
  • 方法详细资料

    • unzip

      public static void unzip(File file, String outputDirectory) throws Exception
      解压文件
      参数:
      file - 待解析文件
      outputDirectory - String
      抛出:
      Exception - Exception
    • unzip

      public static void unzip(String zipFileName, String outputDirectory) throws Exception
      解压文件
      参数:
      zipFileName - 压缩文件名
      outputDirectory - 解压路径(绝对路径)
      抛出:
      Exception - Exception
    • unzip

      public static void unzip(ZipFile zipFile, String outputDirectory) throws Exception
      解压文件
      参数:
      zipFile - 压缩文件
      outputDirectory - 解压路径(绝对路径)
      抛出:
      Exception - Exception
    • zip

      public static void zip(String zipFilePath, String[] filePaths) throws IOException, Exception
      压缩文件
      参数:
      zipFilePath - ZIP文件存放路径
      filePaths - 待压缩文件路径
      抛出:
      IOException - Exception
      Exception - Exception
    • zip

      public static void zip(String zipFilePath, String[] filePaths, String encoding) throws IOException, Exception
      将指定的文件压缩成zip
      参数:
      zipFilePath - ZIP文件存放路径
      filePaths - 待压缩文件路径,包括文件或文件夹
      encoding - 使用编码 默认GB18030
      抛出:
      IOException - IOException
      Exception - Exception