промежуточный. улучшение удаления баг репортов, в процессе отображения диалогового окна

This commit is contained in:
2024-08-18 01:08:56 +03:00
parent de1d81ac33
commit 39e9c634a2
12 changed files with 244 additions and 18 deletions

View 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);
}
}
}
}
}