String zipath = localpath+zipname+".zip";

public static void createNewzip(String zipath) throws Exception {
ZipOutputStream zoutput = null;
try {
File file = new File(zipath);
if(!file.exists())
file.createNewFile();
FileOutputStream fOutputStream = new FileOutputStream(file);
zoutput = new ZipOutputStream(fOutputStream);

} catch (Exception e) {
e.printStackTrace();
}finally{
zoutput.closeEntry();
zoutput.close();
}
}

在localpath下面生成一个名为zipname的zip

相关文章:

  • 2021-09-07
  • 2021-09-18
  • 2022-03-07
  • 2022-12-23
  • 2021-12-20
  • 2022-12-23
  • 2021-04-04
猜你喜欢
  • 2021-12-26
  • 2022-12-23
  • 2018-10-14
  • 2021-11-27
  • 2022-12-23
  • 2021-12-05
  • 2021-06-01
相关资源
相似解决方案