Class JKCompressionUtil

java.lang.Object
com.jk.core.util.JKCompressionUtil

public class JKCompressionUtil extends Object
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 Details

    • JKCompressionUtil

      public JKCompressionUtil()
  • Method Details

    • compress

      public static void compress(String fileName, String compressedFileName, String password)
      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

      public void decompress(String sourceZipFilePath, String extractedZipFilePath, String password)
      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).