import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.tools.zip.ZipOutputStream;
public String createZip(String path,String fileName,String xxdm){
String zipFileName = xxdm + ".zip";
byte[] buf = new byte[1024];
try {
ZipOutputStream out = new ZipOutputStream(new FileOutputStream(path + zipFileName));
FileInputStream in = new FileInputStream(path + fileName);
out.putNextEntry(new org.apache.tools.zip.ZipEntry(fileName));
int len;
while ((len = in.read(buf)) > 0)
{
out.write(buf, 0, len);
}
out.closeEntry();
in.close();
out.close();
}catch (IOException e)
{
e.printStackTrace();
}
return zipFileName;
}