Class ZipCompressor

All Implemented Interfaces:
com.imyeyu.utils.OS.FileSystem

public class ZipCompressor extends Compressor<ZipCompressor>
Zip 压缩器
Version:
2024-06-30 19:46
Author:
夜雨
  • Constructor Details

    • ZipCompressor

      public ZipCompressor()
  • Method Details

    • from

      public static ZipCompressor from(String fromPath)
      创建压缩器
      Parameters:
      fromPath - 源路径
      Returns:
      压缩器
    • from

      public static ZipCompressor from(File fromFile)
      创建压缩器
      Parameters:
      fromFile - 源文件
      Returns:
      压缩器
    • toStream

      protected void toStream(String fromPath, OutputStream toStream) throws Exception
      Description copied from class: Compressor
      执行压缩到输出流
      Specified by:
      toStream in class Compressor<ZipCompressor>
      Parameters:
      fromPath - 源路径
      toStream - 目标输出流
      Throws:
      Exception - 压缩失败