title: Finding a file in zipentry java
body: <p>I am trying to find a file within a zip file and get it as an <code>InputStream</code>. So this is what I am doing to get it so far and I am not certain if I am doing it correctly.</p>
  
  <p>Here is a sample as the original is slightly longer but this is the main component...</p>
  
  <pre><code>public InputStream Search_Image(String file_located, ZipInputStream zip) 
      throws IOException {
      for (ZipEntry zip_e = zip.getNextEntry(); zip_e != null ; zip_e = zip.getNextEntry()) {
          if (file_located.equals(zip_e.getName())) {
              return zip;
          }
          if (zip_e.isDirectory()) {
              Search_Image(file_located, zip); 
          }
      }
      return null;
  }
  </code></pre>
  
  <p>Now the main problem I am facing is that The <code>ZipInputStream</code> in <code>Search_Image</code> is the same as the original component of the <code>ZipInputStream</code>...</p>
  
  <pre><code>if(zip_e.isDirectory()) {
      //"zip" is the same as the original I need a change here to find folders again.
      Search_Image(file_located, zip); 
  }
  </code></pre>
  
  <p>Now for the question, how do you get the <code>ZipInputStream</code> as the new <code>zip_entry</code>? Also please add in if I did anything wrong in my method as my logic with this class is still lacking.</p>