title: Delete META-INF folder
body: <p>I need remove <code>jarFile.jar</code>  > <code>/META-INF</code>   folder.</p>
  
  <p>First, I extract the original <code>jarFile.jar</code> into <code>temp/ folder</code></p>
  
  <p>Then I delete <code>META-INF/</code></p>
  
  <p>And zip it again, no errors, but the file appears corrupt.</p>
  
  <p>Anyone can help me?</p>
  
  <p>EDIT:</p>
  
  <blockquote>
  <pre><code>public static void removeJarFiles(File jarFile, String[] files) throws IOException {
      File tempFolder = new File(jarFile.getParentFile(), "temp/");
      tempFolder.mkdirs();
      unZip(jarFile.getAbsolutePath(), tempFolder.getAbsolutePath()); // Decompress JAR
      // Delete files
      for (String file : files) {
          File f = new File(tempFolder, file);
          if (f.isDirectory()) {
              Util.deleteDir(f);
          } else {
              if (f.exists()) {
                  f.delete();
              }
          }
      }
      jarFile.delete(); // Delete OLD Jar
      // Re-Create JAR
      zipFolder(tempFolder.getAbsolutePath(), jarFile.getAbsolutePath());
  }
  </code></pre>
  </blockquote>