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

26 lines
994 B
Java

package _VisualDVM.Passes.All;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import _VisualDVM.Passes.Server.ClientPass;
import _VisualDVM.Repository.BugReport.BugReport;
import _VisualDVM.Repository.BugReport.BugReportState;
import _VisualDVM.Repository.Server.ComponentsServer;
import _VisualDVM.Repository.Server.ServerCode;
public class SendBugReport extends ClientPass<ComponentsServer,BugReport> {
@Override
protected boolean canStart(Object... args) throws Exception {
target = Global.componentsServer.db.bugReports.getUI().getCurrent();
if (!target.project_version.isEmpty())
target.packed_archive = Utils_.fileToBytes(target.getArchiveFile());
return SendRequest(ServerCode.PublishObject, "", target);
}
@Override
protected void performFail() throws Exception {
target.state = BugReportState.draft;
}
@Override
protected ComponentsServer getServer() {
return Global.componentsServer;
}
}