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

27 lines
1.1 KiB
Java
Raw Normal View History

package Visual_DVM_2021.Passes.All;
2024-10-07 22:04:09 +03:00
import Common.Utils.CommonUtils;
2024-10-09 22:01:19 +03:00
import _VisualDVM.Current;
2024-10-09 22:21:57 +03:00
import _VisualDVM.Repository.BugReport.BugReportInterface;
import _VisualDVM.Repository.BugReport.BugReportState;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
import Visual_DVM_2021.Passes.Server.ComponentsRepositoryPass;
2023-09-17 22:13:42 +03:00
public class SendBugReport extends ComponentsRepositoryPass {
@Override
protected void ServerAction() throws Exception {
if (!Current.getBugReport().project_version.isEmpty()) {
//отправить архив.
Command(new ServerExchangeUnit_2021(ServerCode.SendBugReport,
Current.getBugReport().id,
2024-10-07 22:04:09 +03:00
CommonUtils.fileToBytes(BugReportInterface.getArchiveFile(Current.getBugReport()))
2023-09-17 22:13:42 +03:00
));
}
// синхрон бд
Command(new ServerExchangeUnit_2021(ServerCode.PublishObject, "", Current.getBugReport()));
}
@Override
protected void performFail() throws Exception {
Current.getBugReport().state = BugReportState.draft;
}
}