public final class ZipUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
unzip(String zipFilePath,
String unzipLocation,
boolean isAddToClasspath)
A method to unzip a zip file to given folder path.
|
static void |
unzipFiles(ZipInputStream zipInputStream,
Path unzipFilePath) |
static void |
unzipFromInputStream(String unzipLocation,
InputStream zipInputStream)
Unzips the given input stream to the given directory path.
|
static void |
zip(String sourceDirPath,
String zipFilePath)
A method to zip a folder with given path.
|
public static void zip(String sourceDirPath, String zipFilePath) throws IOException
Note: this zip method does not preserve permissions of files. eg: "execute" permissions.
sourceDirPath - src path to zipzipFilePath - created zip file pathIOException - error while creating the zip filepublic static void unzip(String zipFilePath, String unzipLocation, boolean isAddToClasspath) throws IOException
Note: this unzip method does not preserve permissions of files. eg: "execute" permissions.
zipFilePath - src path of the zipunzipLocation - the path zip should be extracted toisAddToClasspath - if the file is jar, whether add it to the CLI class pathIOException - error while unzipping the filepublic static void unzipFiles(ZipInputStream zipInputStream, Path unzipFilePath) throws IOException
IOExceptionpublic static void unzipFromInputStream(String unzipLocation, InputStream zipInputStream) throws IOException
unzipLocation - The path zip should be extracted tozipInputStream - Input stream of the zip fileIOException - Error while unzipping the fileCopyright © 2024 WSO2. All rights reserved.