упорядочил папки с кодом.

This commit is contained in:
2023-11-19 01:53:56 +03:00
parent 4883b4af51
commit 44c6daffa3
596 changed files with 2140 additions and 1569 deletions

View File

@@ -0,0 +1,58 @@
package Common.Passes.All;
import Common.Current;
import Common.Global;
import Common.UI.UI;
import Common.Utils.Utils;
import Repository.ServerCode;
import Repository.ServerExchangeUnit_2021;
import Repository.TestingSystem.Common.Test.Test;
import Common.Passes.PassCode_2021;
import Common.Passes.Server.TestingSystemPass;
public class DownloadTest extends TestingSystemPass<Test> {
@Override
public String getIconPath() {
return "/icons/DownloadBugReport.png";
}
@Override
public String getButtonText() {
return "";
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (Current.getAccount().CheckRegistered(Log) && Current.Check(Log, Current.Test)) {
target = Current.getTest();
return true;
}
return false;
}
@Override
protected void performPreparation() throws Exception {
passes.get(PassCode_2021.CloseCurrentProject).Do();
Current.set(Current.Root, null); //чтобы гарантированно не существовало корня.
Utils.forceDeleteWithCheck(target.getArchive());
Utils.forceDeleteWithCheck(target.getHomePath());
}
@Override
protected void ServerAction() throws Exception {
Command(new ServerExchangeUnit_2021(ServerCode.DownloadTest, String.valueOf(target.id)));
response.Unpack(target.getArchive());
}
@Override
protected boolean validate() {
return target.getArchive().exists();
}
@Override
protected void performDone() throws Exception {
super.performDone();
if (passes.get(PassCode_2021.UnzipFolderPass).Do(
target.getArchive().getAbsolutePath(),
Global.visualiser.getWorkspace().getAbsolutePath(), false
))
if (UI.Question("Тестовый проект успешно загружен под именем\n" +
Utils.Brackets(target.getHomePath().getName()) +
"\nОткрыть его"))
passes.get(PassCode_2021.OpenCurrentProject).Do(target.getHomePath());
}
}