提交 22f512fa authored 作者: 任建彩's avatar 任建彩

feat:删除文件

1.file
上级 0276348b
......@@ -239,6 +239,7 @@ public class FileController {
}
return null;
}
@ApiOperation(value = "获取文件地址")
@RequestMapping(value = "/getFilePath", method = RequestMethod.GET)
public CallBack<String> downLoad(String fileName) {
......@@ -361,6 +362,21 @@ public class FileController {
return null;
}
@ApiOperation(value = "删除下载后的zip文件")
@RequestMapping(value = "/deleteZip", method = RequestMethod.POST)
public Boolean downLoadResource(String fileName) throws Exception {
String filePath = rootPath+fileName;
//删除源ZIP文件
File file = new File(filePath);
if (file.exists() && file.isFile()) {
String[] cmd = new String[]{"/bin/sh", "-c", "rm -rf " + filePath};
Process process = Runtime.getRuntime().exec(cmd);
}
return true;
}
@ApiOperation(value = "导出二维码zip")
@RequestMapping(value = "/download/zip", method = RequestMethod.GET)
public String downLoad(HttpServletResponse response,String fileName) throws Exception {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论