Class ZipUtils


  • public class ZipUtils
    extends Object
    Utility for zipping files.
    Author:
    Jose Vega, Alfonso Vásquez
    • Constructor Detail

      • ZipUtils

        public ZipUtils()
    • Method Detail

      • zipFiles

        public static void zipFiles​(List<File> files,
                                    OutputStream outputStream)
                             throws IOException
        Zips a collection of files to a destination zip output stream.
        Parameters:
        files - A collection of files and directories
        outputStream - The output stream of the destination zip file
        Throws:
        FileNotFoundException
        IOException
      • zipFiles

        public static void zipFiles​(List<File> files,
                                    File zipFile)
                             throws IOException
        Zips a collection of files to a destination zip file.
        Parameters:
        files - A collection of files and directories
        zipFile - The path of the destination zip file
        Throws:
        FileNotFoundException
        IOException
      • unZipFiles

        public static void unZipFiles​(InputStream inputStream,
                                      File outputFolder)
                               throws IOException
        Unzips a zip from an input stream into an output folder.
        Parameters:
        inputStream - the zip input stream
        outputFolder - the output folder where the files
        Throws:
        IOException
      • unZipFiles

        public static void unZipFiles​(File zipFile,
                                      File outputFolder)
                               throws IOException
        Unzips a zip file into an output folder.
        Parameters:
        zipFile - the zip file
        outputFolder - the output folder where the files
        Throws:
        IOException