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

feat:删除文件

1.file
上级 1185633f
......@@ -126,13 +126,7 @@ public class FileController {
}
filePath = rootPath+entity.getPath()+"/"+entity.getFileName()+entity.getSuffixName();
String path = rootPath+entity.getPath()+"/"+entity.getFileName();
//删除文件夹
File file1 = new File(path);
if (file1.exists() && file1.isDirectory()) {
String[] cmd1 = new String[]{"/bin/sh", "-c", "rm -rf " + path};
Process process1 = Runtime.getRuntime().exec(cmd1);
}
/*if (service.removeById(entity.getId())) {
if (service.removeById(entity.getId())) {
//删除源文件
File file = new File(filePath);
if (file.exists() && file.isFile()) {
......@@ -151,7 +145,7 @@ public class FileController {
String[] cmd2 = new String[]{"/bin/sh", "-c", "rm -rf " + path+".scan"};
Process process2 = Runtime.getRuntime().exec(cmd2);
}
}*/
}
}
}
return CallBack.success(true);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论