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

31 lines
1.1 KiB
Java
Raw Normal View History

2023-09-17 22:13:42 +03:00
package Visual_DVM_2021.Passes.All;
import Common.Global;
import Common.Utils.Utils;
import Repository.BugReport.BugReport;
import Repository.BugReport.BugReportInterface;
import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021;
import Visual_DVM_2021.Passes.ComponentsRepositoryPass;
public class DownloadBugReport extends ComponentsRepositoryPass<BugReport> {
@Override
protected boolean canStart(Object... args) {
target = (BugReport) args[0];
return !BugReportInterface.getArchiveFile(target).exists();
}
@Override
protected void performPreparation() throws Exception {
Utils.CheckDirectory(Global.BugReportsDirectory);
}
@Override
protected void ServerAction() throws Exception {
Command(new ServerExchangeUnit_2021(ServerCode.ReceiveBugReport, target.id));
Utils.unpackFile((byte[]) response.object, BugReportInterface.getArchiveFile(target));
}
@Override
protected boolean validate() {
return BugReportInterface.getArchiveFile(target).exists();
}
}