Commit 3ed5f823 by 姚冰

sendDataFromFile接口过滤解压后空文件夹,提取其它类型错误

1 parent abf6a3c8
......@@ -102,6 +102,10 @@ public class LocalFileServiceImpl implements FileService {
log.info("解压文件成功:{}", path);
List<String> paths = readFileDirectory(path, targetFile);
if (paths == null || paths.size() == 0) {
removeFiles(path);
continue;
}
paths.forEach( filepath -> {
List<BodyRecognition> list = getFileBodyRecognition(filepath, f.getName(), direction);
......@@ -332,7 +336,7 @@ public class LocalFileServiceImpl implements FileService {
private boolean unzipFile(String filename, String path) {
String cmd = "tar xvf " + filename + " -C " + path;
String result = callShellByExec(cmd);
if (result.contains("tar:") || result.contains("Error")) {
if (result.contains("tar:") || result.toLowerCase().contains("error")) {
return false;
}
return true;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!