/** * Checks if this crontab entry looks reasonable, * and if not, return an warning message. * * <p> * The point of this method is to catch syntactically correct * but semantically suspicious combinations, like * "* 0 * * *" */ public String checkSanity() { for (CronTab tab : tabs) { String s = tab.checkSanity(); if(s!=null) return s; } return null; }
/** * Checks if this crontab entry looks reasonable, * and if not, return an warning message. * * <p> * The point of this method is to catch syntactically correct * but semantically suspicious combinations, like * "* 0 * * *" */ public String checkSanity() { for (CronTab tab : tabs) { String s = tab.checkSanity(); if(s!=null) return s; } return null; }
/** * Checks if this crontab entry looks reasonable, * and if not, return an warning message. * * <p> * The point of this method is to catch syntactically correct * but semantically suspicious combinations, like * "* 0 * * *" */ public String checkSanity() { for (CronTab tab : tabs) { String s = tab.checkSanity(); if(s!=null) return s; } return null; }
/** * Checks if this crontab entry looks reasonable, and if not, return an * warning message. * * <p> The point of this method is to catch syntactically correct but * semantically suspicious combinations, like "* 0 * * *" */ public String checkSanity() { for (CronTab tab : tabs) { String s = tab.checkSanity(); if (s != null) { return s; } } return null; }
/** * Checks if this crontab entry looks reasonable, * and if not, return an warning message. * * <p> * The point of this method is to catch syntactically correct * but semantically suspicious combinations, like * "* 0 * * *" */ public String checkSanity() { for (CronTab tab : tabs) { String s = tab.checkSanity(); if(s!=null) return s; } return null; }
/** * Checks if this crontab entry looks reasonable, * and if not, return an warning message. * * <p> * The point of this method is to catch syntactically correct * but semantically suspicious combinations, like * "* 0 * * *" */ public String checkSanity() { for (CronTab tab : tabs) { String s = tab.checkSanity(); if(s!=null) return s; } return null; }
public FormValidation doCheckBackupSchedule(final StaplerRequest res, final StaplerResponse rsp, @QueryParameter("value") final String schedule) { if ((schedule != null) && !schedule.isEmpty()) { String message; try { message = new CronTab(schedule).checkSanity(); } catch (final ANTLRException e) { return FormValidation.error("Invalid cron schedule. " + e.getMessage()); } if (message != null) { return FormValidation.warning("Cron schedule warning: " + message); } else { return FormValidation.ok(); } } else { return FormValidation.ok(); } }