读取zip压缩文件中每个文件的名字

public Test() throws IOException
{
java.util.zip.ZipFile zf = new java.util.zip.ZipFile("d:/Archive.zip");
Enumeration e = zf.entries();
while(e.hasMoreElements())
{
ZipEntry ze = (ZipEntry) e.nextElement();
if(!ze.isDirectory())
System.out.println(new String(ze.getName().getBytes("ISO-8859-1"), "GB2312"));
}
}
public static void main(String[] args) {
try {
new Test();
} catch (IOException e) {
e.printStackTrace();
}
}

你可能感兴趣的:(Java学习总结,Java)