- public class ZipExtractor {
- /**
- * 从ZipInputStream找出给定文件夹下的所有文件,存放在Map中,key=filename ,value=file content string
- * @author huangfei
- * @create 2008-11-13 下午04:16:04
- * @since
- * @param zipInput
- * @param folder 文件夹名
- * @return
- * @throws IOException
- */
- public static Map getFileNameAndStrByFolder(ZipInputStream zipInput,String folder) throws IOException{
- HashMap name_stringMap = new HashMap();
- ZipEntry zipEntry = null;
- while ((zipEntry = zipInput.getNextEntry()) != null) {
- if(isInFolder(zipEntry,folder)){
- int len = new Long(zipEntry.getSize()).intValue();
- String fullName = zipEntry.getName();
- String fileName = suffix2LowerCase(fullName.substring(fullName.lastIndexOf("/")+1));
从ZipInputStream找出给定文件夹下的所有文件,存放在Map中,key=filename ,value=file content string
最新推荐文章于 2023-04-22 22:54:34 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)