Class Zip4jExtensions


  • public final class Zip4jExtensions
    extends java.lang.Object
    The class Zip4jExtensions.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void extract​(net.lingala.zip4j.ZipFile zipFile4j, java.io.File destination, java.lang.String password)
      Extract.
      static net.lingala.zip4j.model.ZipParameters newZipParameters​(net.lingala.zip4j.model.enums.CompressionMethod compressionMethod, net.lingala.zip4j.model.enums.CompressionLevel compressionLevel)
      Factory method for create a new ZipParameters from the given parameters
      static void zipFiles​(net.lingala.zip4j.ZipFile zipFile4j, java.io.File... toAdd)
      Adds a file or several files to the given zip file with the parameters Zip4jConstants.COMP_DEFLATE for the compression method and Zip4jConstants.DEFLATE_LEVEL_NORMAL as the compression level.
      static void zipFiles​(net.lingala.zip4j.ZipFile zipFile4j, net.lingala.zip4j.model.enums.CompressionMethod compressionMethod, net.lingala.zip4j.model.enums.CompressionLevel compressionLevel, java.io.File... toAdd)
      Adds a file or several files to the given zip file with the given parameters for the compression method and the compression level.
      static void zipFiles​(net.lingala.zip4j.ZipFile zipFile4j, net.lingala.zip4j.model.ZipParameters parameters, java.io.File... toAdd)
      Adds the given file(s) to the given zip file.
      static void zipFiles​(net.lingala.zip4j.ZipFile zipFile4j, net.lingala.zip4j.model.ZipParameters parameters, java.io.File directoryToCompress, java.util.function.Predicate<java.io.File> predicate)
      Adds the given file(s) to the given zip file.
      static void zipFiles​(net.lingala.zip4j.ZipFile zipFile4j, net.lingala.zip4j.model.ZipParameters parameters, java.util.List<java.io.File> toAdd)
      Adds the given file(s) to the given zip file.
      • Methods inherited from class java.lang.Object

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

      • extract

        public static void extract​(net.lingala.zip4j.ZipFile zipFile4j,
                                   java.io.File destination,
                                   java.lang.String password)
                            throws net.lingala.zip4j.exception.ZipException
        Extract.
        Parameters:
        zipFile4j - the zip file4j
        destination - the destination
        password - the password
        Throws:
        net.lingala.zip4j.exception.ZipException - the zip exception
      • zipFiles

        public static void zipFiles​(net.lingala.zip4j.ZipFile zipFile4j,
                                    java.io.File... toAdd)
                             throws net.lingala.zip4j.exception.ZipException
        Adds a file or several files to the given zip file with the parameters Zip4jConstants.COMP_DEFLATE for the compression method and Zip4jConstants.DEFLATE_LEVEL_NORMAL as the compression level.
        Parameters:
        zipFile4j - the zip file4j
        toAdd - the to add
        Throws:
        net.lingala.zip4j.exception.ZipException - the zip exception
      • zipFiles

        public static void zipFiles​(net.lingala.zip4j.ZipFile zipFile4j,
                                    net.lingala.zip4j.model.enums.CompressionMethod compressionMethod,
                                    net.lingala.zip4j.model.enums.CompressionLevel compressionLevel,
                                    java.io.File... toAdd)
                             throws net.lingala.zip4j.exception.ZipException
        Adds a file or several files to the given zip file with the given parameters for the compression method and the compression level.
        Parameters:
        zipFile4j - the zip file4j
        compressionMethod - The compression method
        compressionLevel - the compression level
        toAdd - the to add
        Throws:
        net.lingala.zip4j.exception.ZipException - the zip exception
      • newZipParameters

        public static net.lingala.zip4j.model.ZipParameters newZipParameters​(net.lingala.zip4j.model.enums.CompressionMethod compressionMethod,
                                                                             net.lingala.zip4j.model.enums.CompressionLevel compressionLevel)
        Factory method for create a new ZipParameters from the given parameters
        Parameters:
        compressionMethod - The compression method
        compressionLevel - the compression level
        Returns:
        the new ZipParameters object from the given parameters
      • zipFiles

        public static void zipFiles​(net.lingala.zip4j.ZipFile zipFile4j,
                                    net.lingala.zip4j.model.ZipParameters parameters,
                                    java.io.File... toAdd)
                             throws net.lingala.zip4j.exception.ZipException
        Adds the given file(s) to the given zip file.
        Parameters:
        zipFile4j - the zip file4j
        parameters - the parameters
        toAdd - the list with the files to add in the zip file
        Throws:
        net.lingala.zip4j.exception.ZipException - the zip exception
      • zipFiles

        public static void zipFiles​(net.lingala.zip4j.ZipFile zipFile4j,
                                    net.lingala.zip4j.model.ZipParameters parameters,
                                    java.util.List<java.io.File> toAdd)
                             throws net.lingala.zip4j.exception.ZipException
        Adds the given file(s) to the given zip file.
        Parameters:
        zipFile4j - the zip file4j
        parameters - the parameters
        toAdd - the list with the files to add in the zip file
        Throws:
        net.lingala.zip4j.exception.ZipException - the zip exception
      • zipFiles

        public static void zipFiles​(net.lingala.zip4j.ZipFile zipFile4j,
                                    net.lingala.zip4j.model.ZipParameters parameters,
                                    java.io.File directoryToCompress,
                                    java.util.function.Predicate<java.io.File> predicate)
                             throws java.io.IOException
        Adds the given file(s) to the given zip file.
        Parameters:
        zipFile4j - the zip file4j
        parameters - the parameters
        directoryToCompress - the content of this directory will be compressed
        predicate - the predicate that tells which files should be in the zip file
        Throws:
        net.lingala.zip4j.exception.ZipException - the zip exception
        java.io.IOException