Package com.jk.core.util
Class JKCompressionUtil
java.lang.Object
com.jk.core.util.JKCompressionUtil
This class is a utility class thats used for compressing and decompressing
files using Zip format.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
This method compresses a file into a Zip archive with optional encryption and password protection.void
decompress
(String sourceZipFilePath, String extractedZipFilePath, String password) This method decompresses a Zip archive into an extracted folder with optional password protection.
-
Constructor Details
-
JKCompressionUtil
public JKCompressionUtil()
-
-
Method Details
-
compress
This method compresses a file into a Zip archive with optional encryption and password protection.- Parameters:
fileName
- Specifies the name of the file to be compressed.compressedFileName
- Specifies the name of the compressed Zip file.password
- Specifies the password to be used for encryption (null if no encryption).
-
decompress
This method decompresses a Zip archive into an extracted folder with optional password protection.- Parameters:
sourceZipFilePath
- Specifies the path of the source Zip file.extractedZipFilePath
- Specifies the path where the Zip archive will be extracted.password
- Specifies the password used for decryption (null if no encryption).
-