package _VisualDVM.Passes.All; import Common.Utils.Utils_; import _VisualDVM.Global; import _VisualDVM.Passes.Server.ComponentsRepositoryPass; import _VisualDVM.Repository.BugReport.BugReport; import _VisualDVM.Repository.BugReport.BugReportState; import _VisualDVM.Repository.Server.ServerCode; import _VisualDVM.Repository.Server.ServerExchangeUnit_2021; public class SendBugReport extends ComponentsRepositoryPass { @Override protected void ServerAction() throws Exception { target = Global.componentsServer.db.bugReports.getUI().getCurrent(); if (!target.project_version.isEmpty()) { //отправить архив. Command(new ServerExchangeUnit_2021(ServerCode.SendBugReport, target.id, Utils_.fileToBytes(target.getArchiveFile()) )); } // синхрон бд Command(new ServerExchangeUnit_2021(ServerCode.PublishObject, "", target)); } @Override protected void performFail() throws Exception { target.state = BugReportState.draft; } }