промежуточный. улучшение удаления баг репортов, в процессе отображения диалогового окна
This commit is contained in:
41
src/Visual_DVM_2021/Passes/All/GetOldBugReports.java
Normal file
41
src/Visual_DVM_2021/Passes/All/GetOldBugReports.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
public class GetOldBugReports extends Pass_2021<Vector<File>> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = new Vector<>();
|
||||
return true;
|
||||
|
||||
}
|
||||
@Override
|
||||
protected boolean needsAnimation() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
File workspace = Global.visualiser.getWorkspace();
|
||||
File[] files = workspace.listFiles(pathname -> pathname.isDirectory() && pathname.getName().toLowerCase().startsWith("bugreport_"));
|
||||
if (files != null) {
|
||||
//---
|
||||
Calendar c = new GregorianCalendar();
|
||||
c.setTimeInMillis(System.currentTimeMillis());
|
||||
c.add(Calendar.MONTH, -2);
|
||||
Date date = c.getTime();
|
||||
System.out.println(date);
|
||||
long border = date.getTime();
|
||||
//--
|
||||
for (File file: files){
|
||||
ShowMessage2(file.getName());
|
||||
long mdate = Utils.getNewestFileDate(file);
|
||||
if (mdate<=border){
|
||||
target.add(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user