Browse Source

事件文件删除

develop
王兴琳 4 months ago
parent
commit
d354af2edf
  1. 3
      zc-business/src/main/java/com/zc/business/controller/FTPDeletion.java

3
zc-business/src/main/java/com/zc/business/controller/FTPDeletion.java

@ -62,14 +62,12 @@ public class FTPDeletion {
String filePath = parentDirPath + "/" + file.getName(); String filePath = parentDirPath + "/" + file.getName();
if (file.isDirectory()) { if (file.isDirectory()) {
System.out.println("地址"+filePath);
// 如果是目录,则递归调用 // 如果是目录,则递归调用
// 删除30天前的文件 // 删除30天前的文件
Instant lastModifiedTime = file.getTimestamp().toInstant(); Instant lastModifiedTime = file.getTimestamp().toInstant();
String[] split = filePath.split("交通事件"); String[] split = filePath.split("交通事件");
if (split.length>1){ if (split.length>1){
if (!lastModifiedTime.isBefore(thirtyDaysAgoStartOfDay)){ if (!lastModifiedTime.isBefore(thirtyDaysAgoStartOfDay)){
System.out.println("跳回天====="+filePath);
continue; continue;
} }
} }
@ -93,7 +91,6 @@ public class FTPDeletion {
} }
}else { }else {
System.out.println("跳出循环-------------------------------------");
continue; continue;
} }

Loading…
Cancel
Save