Class ZipUtils

java.lang.Object
host.anzo.commons.utils.ZipUtils

public class ZipUtils extends Object
Since:
10.03.2017
  • Constructor Details

    • ZipUtils

      public ZipUtils()
  • Method Details

    • createZipFileSystem

      public static FileSystem createZipFileSystem(String zipFilename, boolean create) throws IOException
      Returns a zip file system
      Parameters:
      zipFilename - to construct the file system from
      create - true if the zip file should be created
      Returns:
      a zip file system
      Throws:
      IOException - if an I/O error occurs creating the file system
    • putFileToZipStream

      public static void putFileToZipStream(String fileName, ZipOutputStream zos)
      Add file to zip archive
      Parameters:
      fileName - path to file
      zos - zip archive output stream
    • compress

      public static byte[] compress(byte[] data)
      Parameters:
      data - bytes to compress
      Returns:
      compressed bytes
    • decompress

      public static byte[] decompress(byte[] data)
      Parameters:
      data - bytes to decompress
      Returns:
      decompressed bytes