title: Extracting Password Protected Files inside ZIP file without losing the protection
body: <p>I am trying to extract a ZIP file which contains a Password Protected PDF file. Below is my Code for Extracting ZIP file.</p>
  
  <pre><code>ZipFile zipFile = new ZipFile(new File("C:\\Users\\sathesh\\Desktop\\temp.zip"));
          if (zipFile.isEncrypted()) {
              zipFile.setPassword("abcd1234");
          }
          zipFile.extractAll("D:\\temp\\final");
  </code></pre>
  
  <p>Once the Code is executed ZIP file is getting extracted but i am losing password protecting applied on PDF file. How to extract a ZIP file without losing the Password Protection on the files. <br/>
  <strong>NOTE</strong> : If i comment <code>zipFile.setPassword("abcd1234");</code> then i'm getting exception </p>
  
  <blockquote>
    <p>Exception in thread "main" net.lingala.zip4j.exception.ZipException: net.lingala.zip4j.exception.ZipException: net.lingala.zip4j.exception.ZipException: empty or null password provided for AES Decryptor
        at net.lingala.zip4j.unzip.Unzip.initExtractFile(Unzip.java:163)
        at net.lingala.zip4j.unzip.Unzip.initExtractAll(Unzip.java:83)
        at net.lingala.zip4j.unzip.Unzip.extractAll(Unzip.java:73)
        at net.lingala.zip4j.core.ZipFile.extractAll(ZipFile.java:488)
        at net.lingala.zip4j.core.ZipFile.extractAll(ZipFile.java:451)
        at Shiva.ZipProtect.zipFileUsingPassProtect(ZipProtect.java:51)
        at Shiva.ZipProtect.main(ZipProtect.java:25)
    Caused by: net.lingala.zip4j.exception.ZipException: net.lingala.zip4j.exception.ZipException: empty or null password provided for AES Decryptor
        at net.lingala.zip4j.unzip.UnzipEngine.unzipFile(UnzipEngine.java:98)
        at net.lingala.zip4j.unzip.Unzip.initExtractFile(Unzip.java:160)
        ... 6 more
    Caused by: net.lingala.zip4j.exception.ZipException: empty or null password provided for AES Decryptor
        at net.lingala.zip4j.crypto.AESDecrypter.init(AESDecrypter.java:99)
        at net.lingala.zip4j.crypto.AESDecrypter.(AESDecrypter.java:65)
        at net.lingala.zip4j.unzip.UnzipEngine.initDecrypter(UnzipEngine.java:202)
        at net.lingala.zip4j.unzip.UnzipEngine.init(UnzipEngine.java:185)
        at net.lingala.zip4j.unzip.UnzipEngine.getInputStream(UnzipEngine.java:118)
        at net.lingala.zip4j.unzip.UnzipEngine.unzipFile(UnzipEngine.java:78)
        ... 7 more</p>
  </blockquote>
  
  <p>I am using <strong>Zip4j</strong> for creating the and extracting the ZIP file.</p>