日期:2014-05-20  浏览次数:20736 次

Java解压指定文件...
比如说Image.zip中有1.gif,2.gif,3.gif,4.gif
我怎样才能只解压4.gif
求高手解答...
谢....有源码更谢.....!

------解决方案--------------------
ZipInputStream zipInputStream = new ZipInputStream(inputStream);
while (true) {
ZipEntry nextEntry = zipInputStream.getNextEntry();
if (nextEntry == null) {
break;
}
if (nextEntry.isDirectory()) {
throw new DSWFException( "上传压缩包中包含文件夹! ");
}
String name = nextEntry.getName();
if (name.equals( "4.gif ")){
//处理这个文件4.gif,即另存一个地方
}
}
......
------解决方案--------------------
楼上应该可行吧