|
|
|
@ -7,6 +7,7 @@ import java.io.*;
|
|
|
|
import java.nio.charset.Charset;
|
|
|
|
import java.nio.charset.Charset;
|
|
|
|
import java.util.Enumeration;
|
|
|
|
import java.util.Enumeration;
|
|
|
|
import java.util.zip.ZipEntry;
|
|
|
|
import java.util.zip.ZipEntry;
|
|
|
|
|
|
|
|
import java.util.zip.ZipException;
|
|
|
|
import java.util.zip.ZipFile;
|
|
|
|
import java.util.zip.ZipFile;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@ -37,7 +38,7 @@ public class CompressFileUtils {
|
|
|
|
if (!pathFile.exists()) {
|
|
|
|
if (!pathFile.exists()) {
|
|
|
|
pathFile.mkdirs();
|
|
|
|
pathFile.mkdirs();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ZipFile zip = new ZipFile(zipFile,Charset.forName("GBK"));
|
|
|
|
try(ZipFile zip = new ZipFile(zipFile,Charset.forName("GBK"))) {
|
|
|
|
for (Enumeration entries = zip.entries(); entries.hasMoreElements(); ) {
|
|
|
|
for (Enumeration entries = zip.entries(); entries.hasMoreElements(); ) {
|
|
|
|
ZipEntry entry = (ZipEntry) entries.nextElement();
|
|
|
|
ZipEntry entry = (ZipEntry) entries.nextElement();
|
|
|
|
String zipEntryName = entry.getName();
|
|
|
|
String zipEntryName = entry.getName();
|
|
|
|
@ -65,6 +66,10 @@ public class CompressFileUtils {
|
|
|
|
in.close();
|
|
|
|
in.close();
|
|
|
|
out.close();
|
|
|
|
out.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (ZipException e) {
|
|
|
|
|
|
|
|
// 特定的Zip文件异常处理
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
//System.out.println("******************解压完毕********************");
|
|
|
|
//System.out.println("******************解压完毕********************");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|