no message

This commit is contained in:
2024-10-14 12:14:01 +03:00
parent 3a29898d5f
commit 452c4c7268
466 changed files with 1255 additions and 1100 deletions

View File

@@ -0,0 +1,59 @@
package _VisualDVM.Passes.All;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Utils;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
import _VisualDVM.Passes.Server.ComponentsRepositoryPass;
import _VisualDVM.Passes.PassCode;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.nio.file.Paths;
public class DownloadAllBugReportsArchives extends ComponentsRepositoryPass<File> {
@Override
public String getIconPath() {
return "/icons/DownloadAll.png";
}
@Override
public String getButtonText() {
return "";
}
@Override
protected void performPreparation() throws Exception {
Global.mainModule.getPass(PassCode.CloseCurrentProject).Do();
Global.mainModule.set(Current.Root, null); //чтобы гарантированно не существовало корня.
Utils.CleanDirectory(Global.BugReportsDirectory);
}
@Override
protected int getTimeout() {
return 60000;
}
@Override
protected void ServerAction() throws Exception {
Command(new ServerExchangeUnit_2021(ServerCode.ReceiveAllArchives));
response.Unpack(target = Utils.getTempFileName("bugs"));
}
@Override
protected boolean validate() {
return target.exists();
}
@Override
protected void performDone() throws Exception {
File tempFolder = Utils.getTempFileName("bugsBuffer");
//-
Global.mainModule.getPass(PassCode.UnzipFolderPass).Do(
target.getAbsolutePath(),
tempFolder.getAbsolutePath()
);
//-
//теперь скопировать это в папку Bugs, с нормальными именами через zip
File t2 = Paths.get(tempFolder.getAbsolutePath(), "Bugs").toFile();
File[] archives = t2.listFiles();
if (archives != null) {
for (File file : archives) {
FileUtils.moveFile(file, Paths.get(Global.BugReportsDirectory.getAbsolutePath(), file.getName() + ".zip").toFile());
}
}
}
}