Class UnzipUtility

java.lang.Object
net.agilhard.maven.plugins.jpacktool.handler.UnzipUtility

public class UnzipUtility
extends java.lang.Object
This utility extracts files and directories of a standard zip file to a destination directory.
  • Method Summary

    Modifier and Type Method Description
    static java.util.List<java.io.File> collect​(java.io.File zipFile, java.io.File destDir)
    Collect a list of files in a destination Directory from entries in the zip file specified by the zipFilePath but do not actually create the files.
    static void unzip​(java.io.File zipFile, java.io.File destDir)
    Extracts a zip file specified by the zipFilePath to a directory specified by destDirectory (will be created if does not exists)

    Methods inherited from class java.lang.Object

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

    • unzip

      public static void unzip​(java.io.File zipFile, java.io.File destDir) throws java.io.IOException
      Extracts a zip file specified by the zipFilePath to a directory specified by destDirectory (will be created if does not exists)
      Parameters:
      zipFile - the zip file
      destDir - the destination Directory
      Throws:
      java.io.IOException - on I/O Errror
    • collect

      public static java.util.List<java.io.File> collect​(java.io.File zipFile, java.io.File destDir) throws java.io.IOException
      Collect a list of files in a destination Directory from entries in the zip file specified by the zipFilePath but do not actually create the files.
      Parameters:
      zipFile - the zip file
      destDir - the destination Directory
      Returns:
      the list of files generated
      Throws:
      java.io.IOException - on I/O Errror