Files
VisualSapfor/src/Visual_DVM_2021/Passes/All/TestPass.java

48 lines
1.8 KiB
Java
Raw Normal View History

2023-09-17 22:13:42 +03:00
package Visual_DVM_2021.Passes.All;
2023-11-08 23:13:16 +03:00
import Common.Utils.Utils;
import Visual_DVM_2021.Passes.PassCode_2021;
2023-09-17 22:13:42 +03:00
import Visual_DVM_2021.Passes.Pass_2021;
2023-11-08 23:13:16 +03:00
import java.io.File;
import java.nio.file.Paths;
2023-09-17 22:13:42 +03:00
public class TestPass extends Pass_2021 {
2023-11-08 23:13:16 +03:00
@Override
protected boolean needsAnimation() {
return super.needsAnimation();
}
@Override
protected void body() throws Exception {
File[] bugsFiles = Paths.get(System.getProperty("user.dir"), "Bugs").toFile().listFiles();
if (bugsFiles != null) {
for (File archive : bugsFiles) {
if (archive.isFile()) {
//----
File tmp = Utils.getTempFileName("archive");
//--
Pass_2021 unzip = passes.get(PassCode_2021.UnzipFolderPass);
unzip.Do(archive.getAbsolutePath(), tmp.getAbsolutePath(), false);
//--
File project = null;
//--
File[] files = tmp.listFiles();
if (files != null) {
for (File file : files) {
if (file.isDirectory())
project = file;
}
}
if (project != null) {
//--
Utils.deleteFilesByExtensions(project, "dep", "opt", "err", "proj");
//--
//на самом деле тут должен быть archive
Utils.forceDeleteWithCheck(archive);
Pass_2021 zip = passes.get(PassCode_2021.ZipFolderPass);
zip.Do(project.getAbsolutePath(), archive.getAbsolutePath());
}
}
}
}
}
2023-09-17 22:13:42 +03:00
}