Class ZipUtils
- java.lang.Object
-
- io.mosip.kernel.packetmanager.util.ZipUtils
-
public class ZipUtils extends Object
Class to unzip the packets- Since:
- 1.0.0
- Author:
- Sowmya
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanunzipAndCheckIsFileExist(InputStream packetStream, String file)Method to unzip the file in-memeory and search the required file existsstatic InputStreamunzipAndGetFile(InputStream packetStream, String file)Method to unzip the file in-memeory and search the required file and return itstatic voidunZipFromInputStream(InputStream input, String desDir)Method to unzip the file for passed destination path
-
-
-
Method Detail
-
unzipAndGetFile
public static InputStream unzipAndGetFile(InputStream packetStream, String file) throws IOException
Method to unzip the file in-memeory and search the required file and return it- Parameters:
packetStream- zip file to be unzippedfile- file to search within zip file- Returns:
- return the corresponding file as inputStream
- Throws:
IOException- if any error occored while unzipping the file
-
unzipAndCheckIsFileExist
public static boolean unzipAndCheckIsFileExist(InputStream packetStream, String file) throws IOException
Method to unzip the file in-memeory and search the required file exists- Parameters:
packetStream- zip file to be unzippedfile- file to search within zip file- Returns:
- return true if found the required file, false otherwise
- Throws:
IOException- if any error occored while unzipping the file
-
unZipFromInputStream
public static void unZipFromInputStream(InputStream input, String desDir) throws IOException
Method to unzip the file for passed destination path- Parameters:
input- zip file to be unzippeddesDir- location where to unzip the files- Throws:
IOException- if any error occurred while unzipping
-
-