Enumeration enum = input.entries(); for (; enum.hasMoreElements();) { JarEntry entry = (JarEntry) enum.nextElement();
Enumeration enumeration = input.entries(); for (; enumeration.hasMoreElements();) { JarEntry entry = (JarEntry) enumeration.nextElement();
	public static void unjar(File jarFile, File targetDir) 	throws FileNotFoundException, IOException 	{		// clear target directory:		if (targetDir.exists()) {			targetDir.delete();		}		// create new target directory:		targetDir.mkdirs(); 		// read jar-file:		String targetPath = targetDir.getAbsolutePath() + File.separatorChar;		byte[] buffer = new byte[ 1024 * 1024 ];		JarFile input = new JarFile( jarFile, false, JarFile.OPEN_READ );		Enumeration enum = input.entries();		for (; enum.hasMoreElements();) {			JarEntry entry = (JarEntry) enum.nextElement();			if (!entry.isDirectory()) {				// do not copy anything from the package cache:				if (entry.getName().indexOf("package cache") == -1) {					String path = targetPath + entry.getName();					File file = new File( path );					if (!file.getParentFile().exists()) {						file.getParentFile().mkdirs();					}					FileOutputStream out = new FileOutputStream( file);					InputStream in = input.getInputStream(entry);					int read;					while ( (read = in.read( buffer )) != -1) {						out.write( buffer, 0, read );					}					in.close();					out.close();				}			}		}