Class ZipArchive

    • Constructor Detail

      • ZipArchive

        public ZipArchive​(File zipFile)
        Create a new ZipArchive instance from the specified zip file.
        Parameters:
        zipFile - the zip file
    • Method Detail

      • unpack

        public static void unpack​(File file,
                                  Folder destination)
        Unzip the specified zip file into a folder.
        Parameters:
        file - the file to unzip (this must reference a zip file)
        destination - the destination folder
      • unpack

        public static void unpack​(java.io.InputStream inputStream,
                                  Folder destination)
        Unzip the specified input stream into a folder.
        Parameters:
        inputStream - the input stream to unzip (this must contain zip contents)
        destination - the destination folder
      • compress

        public static void compress​(Folder folder,
                                    File file)
      • compress

        public static java.io.InputStream compress​(Folder folder)
        Create a InputStream containing a zip representation of the given folder.
        Parameters:
        folder - the folder to compress
      • compress

        public static java.io.InputStream compress​(Folder folder,
                                                   java.lang.String prefix)
        Create a InputStream containing a zip representation of the given folder.
        Parameters:
        folder - the folder to compress
        prefix - an optional entry prefix. This allows a entries to be nested within a folder if required
      • compress

        public static java.io.InputStream compress​(Resources<?> resources)
        Create a InputStream containing a zip representation of the given resources.
        Parameters:
        resources - resources to compress
      • compress

        public static java.io.InputStream compress​(Resources<?> resources,
                                                   java.lang.String prefix)
        Create a InputStream containing a zip representation of the given resources.
        Parameters:
        resources - resources to compress
        prefix - an optional entry prefix. This allows a entries to be nested within a folder if required