Package io.hawt.util

Class Zips


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

      Constructors 
      Constructor Description
      Zips()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void createZipFile​(org.slf4j.Logger log, java.io.File sourceDir, java.io.File outputZipFile)
      Creates a zip fie from the given source directory and output zip file name
      static void createZipFile​(org.slf4j.Logger log, java.io.File sourceDir, java.io.File outputZipFile, java.io.FileFilter filter)  
      protected static boolean matches​(java.io.FileFilter filter, java.io.File f)  
      static void unzip​(java.io.InputStream in, java.io.File toDir)
      Unzips the given input stream of a ZIP to the given directory
      static void zipDirectory​(org.slf4j.Logger log, java.io.File directory, java.util.zip.ZipOutputStream zos, java.lang.String path, java.io.FileFilter filter)
      Zips the directory recursively into the ZIP stream given the starting path and optional filter
      • Methods inherited from class java.lang.Object

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

      • Zips

        public Zips()
    • Method Detail

      • createZipFile

        public static void createZipFile​(org.slf4j.Logger log,
                                         java.io.File sourceDir,
                                         java.io.File outputZipFile)
                                  throws java.io.IOException
        Creates a zip fie from the given source directory and output zip file name
        Throws:
        java.io.IOException
      • createZipFile

        public static void createZipFile​(org.slf4j.Logger log,
                                         java.io.File sourceDir,
                                         java.io.File outputZipFile,
                                         java.io.FileFilter filter)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • zipDirectory

        public static void zipDirectory​(org.slf4j.Logger log,
                                        java.io.File directory,
                                        java.util.zip.ZipOutputStream zos,
                                        java.lang.String path,
                                        java.io.FileFilter filter)
                                 throws java.io.IOException
        Zips the directory recursively into the ZIP stream given the starting path and optional filter
        Throws:
        java.io.IOException
      • matches

        protected static boolean matches​(java.io.FileFilter filter,
                                         java.io.File f)
      • unzip

        public static void unzip​(java.io.InputStream in,
                                 java.io.File toDir)
                          throws java.io.IOException
        Unzips the given input stream of a ZIP to the given directory
        Throws:
        java.io.IOException