Package com.seeq.utilities.process
Class FileUnzipper
java.lang.Object
com.seeq.utilities.process.FileUnzipper
This utility class is used to unzip a zip file into a target directory.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
unzip
(InputStream inputStream, Path destinationFolder) Unzip a zip file in a target folder.void
unzip
(InputStream inputStream, Path destinationFolder, boolean reCreateSubfolders) Unzip a zip file in a target folder.
-
Constructor Details
-
FileUnzipper
public FileUnzipper()
-
-
Method Details
-
unzip
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 streamdestinationFolder
- 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 streamdestinationFolder
- the folder where the zip will be unzippedreCreateSubfolders
- if the subfolders from the zip should be deleted in the target before extracting- Throws:
IOException
-