Package hec.util

Class ZipUtility

java.lang.Object
hec.util.ZipUtility

public class ZipUtility extends Object
A utility class that allows you to extract zip files.
  • Field Details

  • Constructor Details

    • ZipUtility

      public ZipUtility()
  • Method Details

    • extractZipFile

      public static int extractZipFile(String zipFile, String outputDirectory)
      Extracts a given zip file to a directory passed in as an argument.
      Parameters:
      zipFile - a valid File location containing a Zip file
      outputDirectory - the location of the image, relative to the url argument
      Returns:
      ZipUtility#SUCCESS if everything is successful ZipUtility#SETUP_OR_ZIP_EXCEPTION there was a ZipException ZipUtility#IO_EXCEPTION there was a IOException ZipUtility#PARTIAL_EXTRACTION zip file was partially extracted successfully
    • zip

      public static byte[] zip(byte[] unzipped)
      zip the unzipped byte[]
      Parameters:
      unzipped - the uncompressed byte[]
      Returns:
      the compressed byte[]
    • unzip

      public static byte[] unzip(byte[] zipped)
      unzip the zipped byte[]
      Parameters:
      zipped - the uncompressed byte[]
      Returns:
      the uncompressed byte[]