|
|
|
|
@ -24,8 +24,8 @@ public class CronTab {
|
|
|
|
|
|
|
|
|
|
private static LocalDateTime now;
|
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 0 0 * * ?")
|
|
|
|
|
//@Scheduled(cron = "0 0/1 * * * *")
|
|
|
|
|
//@Scheduled(cron = "0 0 0 * * ?")
|
|
|
|
|
@Scheduled(cron = "0 0/1 * * * *")
|
|
|
|
|
public void file() {
|
|
|
|
|
log.info(" corn delete file");
|
|
|
|
|
now = LocalDateTime.now();
|
|
|
|
|
@ -39,6 +39,10 @@ public class CronTab {
|
|
|
|
|
|
|
|
|
|
if (dir.isDirectory()) {
|
|
|
|
|
String[] children = dir.list();
|
|
|
|
|
if(children.length == 0){
|
|
|
|
|
log.info("delete path:{}",dir.getPath());
|
|
|
|
|
dir.delete();
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < children.length; i++) {
|
|
|
|
|
checkFileTime(new File(dir, children[i]),days);
|
|
|
|
|
}
|
|
|
|
|
|