程序包 cool.scx.util

类 ZipBuilder

java.lang.Object
cool.scx.util.ZipBuilder

public class ZipBuilder extends Object
简化 zip 的创建
版本:
0.1.4
作者:
scx567888
  • 构造器详细资料

    • ZipBuilder

      public ZipBuilder()
  • 方法详细资料

    • put

      public ZipBuilder put(String path)

      put.

      参数:
      path - a String object
      返回:
      a
    • put

      public ZipBuilder put(String path, File f)

      put.

      参数:
      path - a String object
      f - a File object
      返回:
      a
    • put

      public ZipBuilder put(String path, byte[] bytes)

      put.

      参数:
      path - a String object
      bytes - an array of byte objects
      返回:
      a
    • remove

      public ZipBuilder remove(String path)

      remove.

      参数:
      path - a String object
      返回:
      a
    • writeToZipOutputStream

      public void writeToZipOutputStream(ZipOutputStream zos) throws Exception

      writeToZipOutputStream.

      参数:
      zos - a ZipOutputStream object
      抛出:
      Exception - if any.
    • toZipBytes

      public byte[] toZipBytes() throws Exception
      将 virtualFile 转换为 byte 数组 方便前台用户下载使用
      返回:
      a
      抛出:
      Exception - a
    • toZipFile

      public void toZipFile(Path outputPath) throws Exception
      将一个虚拟文件压缩
      参数:
      outputPath - a
      抛出:
      Exception - a