Class ZipHelper


  • public class ZipHelper
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ZipHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void compressDirectoryToSevenZipFile​(java.lang.String directory, java.lang.String sevenZipFile)  
      static void compressDirectoryToZipFile​(java.lang.String directory, java.lang.String zipFile, int compressionLevel)
      Compresses the contents of the given directory (files and sub-directories) in to a Zip file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ZipHelper

        public ZipHelper()
    • Method Detail

      • compressDirectoryToSevenZipFile

        public static void compressDirectoryToSevenZipFile​(java.lang.String directory,
                                                           java.lang.String sevenZipFile)
                                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • compressDirectoryToZipFile

        public static void compressDirectoryToZipFile​(java.lang.String directory,
                                                      java.lang.String zipFile,
                                                      int compressionLevel)
                                               throws java.io.IOException,
                                                      java.io.FileNotFoundException
        Compresses the contents of the given directory (files and sub-directories) in to a Zip file.
        Parameters:
        directory - The directory to archive into the Zip file.
        zipFile - Where to write the Zip file.
        compressionLevel - What level of compression to use between 0 and 9, with 0 being no compression and 9 being the most compression.
        Throws:
        java.io.IOException - Thrown if there are issues with IO
        java.io.FileNotFoundException - Thrown if file is not found