title: FileOutputStream throws FileNotFoundException when UnZipping
body: <p>I'm using a class that I found through google to unzip a .zip file.. The .zip contains files and folder. The problem is that <code>FileOutputStream</code> <code>throws</code> <code>FileNotFoundException</code>.. But the file should  be taken from     the .zip file so how can it previously exist?<br>
  Here is the code I'm using in the <code>AsyncTask</code>:</p>
  
  <pre><code>@Override
  protected Boolean doInBackground(String... params) {
      try {
  
          String zipFile = Path + FileName;
  
          FileInputStream fin = new FileInputStream(zipFile);
          ZipInputStream zin = new ZipInputStream(fin);
          ZipEntry ze = null;
          while ((ze = zin.getNextEntry()) != null) {
  
              if (ze.isDirectory()) {
                  dirChecker(ze.getName());
              } else {
                  FileOutputStream fout = new FileOutputStream(Path
                          + ze.getName()); // &lt;-- crashes here
                  while ((length = zin.read(buffer)) &gt; 0) {
                      fout.write(buffer, 0, length);
                      publishProgress(length);
  
                  }
  
                  zin.closeEntry();
                  fout.close();
              }
  
          }
          zin.close();
      } catch (Exception e) {
          mProgressDialog.dismiss();
          return false;
      }
  
      return true;
    }
  </code></pre>
  
  <p>Another <code>AsyncTask</code> which downloads the .zip:</p>
  
  <pre><code>@Override
  protected Boolean doInBackground(String... params) {
        try {
            URL url = new URL(params[0]);
            URLConnection conexion = url.openConnection();
  
            conexion.connect();
  
            int lenghtOfFile = conexion.getContentLength();
            File f = new File(Path+FileName);
            if(!f.exists())
            {
                f.mkdirs();
                if(!f.createNewFile())
                {
                    f.delete();
                    f.createNewFile();
                }
            }
  
            InputStream input = new BufferedInputStream(url.openStream());
            OutputStream output = new FileOutputStream(Path+FileName);
  
            byte data[] = new byte[1024];
  
            long total = 0;
  
            while ((count = input.read(data)) != -1) {
                total += count;
                publishProgress((int)((total*100)/lenghtOfFile));
                output.write(data, 0, count);
            }
  
            output.flush();
            output.close();
            input.close();
            return true;
        } catch (Exception e)     
        {
          e.printStackTrace();
          e.getCause();
          return false;
        }
  </code></pre>
  
  <p>I get again the <code>FileNotFoundExcpetion</code> with (is a directory) message error!.</p>