title: java.io.FileNotFoundException - zip4j
body: <p>I tried to create a simple Java Program which tries to unzip the zip file with zip4j. But everytime i get a java.io.FileNotFoundException. I dont know why because the path exists and the file is write able for java. Also the zip file isnt corrupt.</p>
  
  <p>I run the latest jdk with the lates zip4j library. All is correctly implementet. I tried to unzip a zip which includes only a jar and it worked. But a zip with more files failed. </p>
  
  <p>Iam new to Java and new to working with zip4j.</p>
  
  <pre><code>String enviorment = new File(".").getCanonicalPath();
  unzip(enviorment + "/../WITCLASS/cache/dokumentation.zip", enviorment + "/../WITCLASS/cache/");
  </code></pre>
  
  <p>The .zip file includes some .html and .js files</p>
  
  <pre><code>private static void unzip(String zipFilePath, String destDir) {
          String source = zipFilePath;
          String destination = destDir;
          String password = "";
  
          try {
              ZipFile zipFile = new ZipFile(source);
              if (zipFile.isEncrypted()) {
                  zipFile.setPassword(password);
              }
              zipFile.extractAll(destination);
          } catch (ZipException e) {
              e.printStackTrace();
              System.out.println(e);
          }
      }
  </code></pre>
  
  <p>The expected output would be: all files succesfull unzipped.</p>
  
  <p>But i got only: </p>
  
  <pre><code>net.lingala.zip4j.exception.ZipException: net.lingala.zip4j.exception.ZipException: net.lingala.zip4j.exception.ZipException: java.io.FileNotFoundException: /home/user/Downloads/ENGINE/../WITCLASS/cache/dokumentation/example/elements.html (Not a directory)
      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 NavigationBar.unzip(NavigationBar.java:329)
      at NavigationBar.aptget(NavigationBar.java:205)
      at NavigationBar$ScriptBridge.execute(NavigationBar.java:163)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
      at com.sun.webkit.Utilities.lambda$fwkInvokeWithContext$0(Utilities.java:94)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.webkit.Utilities.fwkInvokeWithContext(Utilities.java:94)
      at com.sun.webkit.WebPage.twkProcessMouseEvent(Native Method)
      at com.sun.webkit.WebPage.dispatchMouseEvent(WebPage.java:807)
      at javafx.scene.web.WebView.processMouseEvent(WebView.java:1045)
      at javafx.scene.web.WebView.lambda$registerEventHandlers$3(WebView.java:1168)
      at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
      at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
      at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
      at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
      at javafx.event.Event.fireEvent(Event.java:198)
      at javafx.scene.Scene$MouseHandler.process(Scene.java:3757)
      at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
      at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
      at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:394)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:432)
      at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:431)
      at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
      at com.sun.glass.ui.View.notifyMouse(View.java:937)
      at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
      at com.sun.glass.ui.gtk.GtkApplication.lambda$null$5(GtkApplication.java:139)
      at java.lang.Thread.run(Thread.java:748)
  Caused by: net.lingala.zip4j.exception.ZipException: net.lingala.zip4j.exception.ZipException: java.io.FileNotFoundException: /home/user/Downloads/ENGINE/../WITCLASS/cache/dokumentation/example/elements.html (Not a directory)
      at net.lingala.zip4j.unzip.UnzipEngine.unzipFile(UnzipEngine.java:98)
      at net.lingala.zip4j.unzip.Unzip.initExtractFile(Unzip.java:160)
      ... 53 more
  Caused by: net.lingala.zip4j.exception.ZipException: java.io.FileNotFoundException: /home/user/Downloads/ENGINE/../WITCLASS/cache/dokumentation/example/elements.html (Not a directory)
      at net.lingala.zip4j.unzip.UnzipEngine.getOutputStream(UnzipEngine.java:435)
      at net.lingala.zip4j.unzip.UnzipEngine.unzipFile(UnzipEngine.java:79)
      ... 54 more
  Caused by: java.io.FileNotFoundException: /home/user/Downloads/ENGINE/../WITCLASS/cache/dokumentation/example/elements.html (Not a directory)
      at java.io.FileOutputStream.open0(Native Method)
      at java.io.FileOutputStream.open(FileOutputStream.java:270)
      at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:213)
      at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:162)
      at net.lingala.zip4j.unzip.UnzipEngine.getOutputStream(UnzipEngine.java:432)
      ... 55 more
  </code></pre>
  
  <p>Source where i find out how to unzip:
  <a href="https://stackoverflow.com/questions/9324933/what-is-a-good-java-library-to-zip-unzip-files">What is a good Java library to zip/unzip files?</a></p>