在Zip文件中查找文件
import java.io.IOException; import java.util.Enumeration; import java.util.zip.ZipEntry;// from nowjava.com - 时代Java import java.util.zip.ZipFile; public class Main { public static void main(String args[]) { try { ZipFile sourceZipFile = new ZipFile("c:/Demo.zip"); String searchFileName = "readme.txt"; Enumeration e = sourceZipFile.entries(); boolean found = false; System.out.println("Trying to search " + searchFileName + " in " + sourceZipFile.getName()); while(e.hasMoreElements())/** 来 自 nowjava - 时代Java**/ { ZipEntry entry = (ZipEntry)e.nextElement(); if(entry.getName().toLowerCase().indexOf(searchFileName) != -1) { found = true; System.out.println("Found " + entry.getName()); } } if(found == false) { System.out.println("File :" + searchFileName +