Here you can find the source of getEntriesNames(File zipFile)
public static ArrayList<String> getEntriesNames(File zipFile) throws ZipException, IOException
//package com.java2s; import java.io.File; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Enumeration; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; public class Main { private static final String ENCODE_GB2312 = "GB2312"; private static final String ENCODE_8859_1 = "8859_1"; public static ArrayList<String> getEntriesNames(File zipFile) throws ZipException, IOException { ArrayList<String> entryNames = new ArrayList<String>(); Enumeration<?> entries = getEntriesEnumeration(zipFile); while (entries.hasMoreElements()) { ZipEntry entry = ((ZipEntry) entries.nextElement()); entryNames.add(new String(getEntryName(entry).getBytes( ENCODE_GB2312), ENCODE_8859_1)); }/*from w ww . j ava 2 s . co m*/ return entryNames; } public static Enumeration<?> getEntriesEnumeration(File zipFile) throws ZipException, IOException { ZipFile zf = new ZipFile(zipFile); return zf.entries(); } public static String getEntryName(ZipEntry entry) throws UnsupportedEncodingException { return new String(entry.getName().getBytes(ENCODE_GB2312), ENCODE_8859_1); } }