Here you can find the source of GetFileList(String zipFileString, boolean bContainFolder, boolean bContainFile)
public static List<File> GetFileList(String zipFileString, boolean bContainFolder, boolean bContainFile) throws Exception
//package com.java2s; import java.io.File; import java.io.FileInputStream; import java.util.ArrayList; import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; public class Main { public static List<File> GetFileList(String zipFileString, boolean bContainFolder, boolean bContainFile) throws Exception { List<File> fileList = new ArrayList<File>(); ZipInputStream inZip = new ZipInputStream(new FileInputStream( zipFileString));/*w ww . ja va2 s .co m*/ ZipEntry zipEntry; String szName = ""; while ((zipEntry = inZip.getNextEntry()) != null) { szName = zipEntry.getName(); if (zipEntry.isDirectory()) { // get the folder name of the widget szName = szName.substring(0, szName.length() - 1); File folder = new File(szName); if (bContainFolder) { fileList.add(folder); } } else { File file = new File(szName); if (bContainFile) { fileList.add(file); } } }// end of while inZip.close(); return fileList; } }