package _VisualDVM.Passes.All;
import Common.Database.Database;
import Common.Passes.DeleteObjectPass;
import Common.Utils.Utils_;
import _VisualDVM.ComponentsServer.BugReport.BugReport;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
public class DeleteBugReport extends DeleteObjectPass<BugReport> {
    public DeleteBugReport() {
        super(BugReport.class);
    }
    @Override
    protected boolean canStart(Object... args) throws Exception {
        return super.canStart(args) && target.canModify(Global.mainModule.getAccount(), Log);
    }
    @Override
    protected void performDone() throws Exception {
        super.performDone();
        Utils_.forceDeleteWithCheck(target.getHome());
        Global.mainModule.getPass(PassCode.DeleteBugReportFromServer).Do(target);
    }
    @Override
    protected Database getDb() {
        return Global.componentsServer.db;
    }
}
