Class FileUnzipper

java.lang.Object
com.seeq.utilities.process.FileUnzipper

public class FileUnzipper extends Object
This utility class is used to unzip a zip file into a target directory.
  • Constructor Details

    • FileUnzipper

      public FileUnzipper()
  • Method Details

    • unzip

      public void unzip(InputStream inputStream, Path destinationFolder) throws IOException
      Unzip a zip file in a target folder. System checks and makes sure the zip entries cannot affect the file system outside the target folder.
      Parameters:
      inputStream - the input stream
      destinationFolder - the folder where the zip will be unzipped
      Throws:
      IOException
    • unzip

      public void unzip(InputStream inputStream, Path destinationFolder, boolean reCreateSubfolders) throws IOException
      Unzip a zip file in a target folder. System checks and makes sure the zip entries cannot affect the file system outside the target folder.
      Parameters:
      inputStream - the input stream
      destinationFolder - the folder where the zip will be unzipped
      reCreateSubfolders - if the subfolders from the zip should be deleted in the target before extracting
      Throws:
      IOException