no message

This commit is contained in:
2023-10-25 02:20:57 +03:00
parent 37c7bbda44
commit 99b24b3eba
9 changed files with 82 additions and 47 deletions

View File

@@ -0,0 +1,40 @@
package Visual_DVM_2021.Passes.All;
import Common.Current;
import Common.Utils.Utils;
import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
import TestingSystem.TasksPackage.TasksPackageState;
import Visual_DVM_2021.Passes.TestingSystemPass;
import java.io.File;
public class DownloadSapforTasksPackage extends TestingSystemPass<SapforTasksPackage> {
@Override
public String getIconPath() {
return "/icons/DownloadAll.png";
}
@Override
public String getButtonText() {
return "";
}
File dst = null;
@Override
protected boolean canStart(Object... args) throws Exception {
if (Current.Check(Log, Current.SapforTasksPackage)) {
target = Current.getSapforTasksPackage();
if (target.state.equals(TasksPackageState.Done)) return true;
else Log.Writeln_("Пакет не завершен.");
}
return false;
}
@Override
protected void ServerAction() throws Exception {
Command(new ServerExchangeUnit_2021(ServerCode.DownloadSapforTasksPackage, Current.getAccount().email, target.id));
response.Unpack(dst = Utils.getTempFileName(target.id));
}
@Override
protected boolean validate() {
return dst!=null&&dst.exists();
}
}