public static String UnZip(String zipFileName)
{
String fileName="";
try{
InputStream inputStream;
byte[] buffer=new byte[1024];
ZipFile zf= new ZipFile(zipFileName);
Enumeration e = zf.entries();
while(e.hasMoreElements())
{
ZipEntry ze = (ZipEntry)e.nextElement();
inputStream= zf.getInputStream(ze);
fileName=ze.getName();
//new String(ze.getName().getBytes("gb2312"),"gb2312");
ze.getSize();
File file=new File("/"+fileName);
OutputStream out = new FileOutputStream(file);
int realLength;
while ((realLength = inputStream.read(buffer)) != -1)
{
out.write(buffer, 0, realLength);
}
inputStream.close();
out.close();
} catch(Exception e)
{ e.printStackTrace(); }
return fileName; }
浙公网安备 33010602011771号