/** * Makes the folder disabled. Will have no effect if the folder type does not {@linkplain #supportsMakeDisabled()}. * @param disabled {@code true} if the folder should be disabled. * @throws IOException if the operation could not complete. * @since 6.1.0 */ public void makeDisabled(boolean disabled) throws IOException { if (isDisabled() == disabled) { return; // noop } if (disabled && !supportsMakeDisabled()) { return; // do nothing if the disabling is unsupported } setDisabled(disabled); if (disabled && this instanceof Queue.Task) { Jenkins.get().getQueue().cancel((Queue.Task)this); } save(); ItemListener.fireOnUpdated(this); }
/** * Makes the folder disabled. Will have no effect if the folder type does not {@linkplain #supportsMakeDisabled()}. * @param disabled {@code true} if the folder should be disabled. * @throws IOException if the operation could not complete. * @since 6.1.0 */ public void makeDisabled(boolean disabled) throws IOException { if (isDisabled() == disabled) { return; // noop } if (disabled && !supportsMakeDisabled()) { return; // do nothing if the disabling is unsupported } setDisabled(disabled); if (disabled && this instanceof Queue.Task) { Jenkins.getActiveInstance().getQueue().cancel((Queue.Task)this); } save(); ItemListener.fireOnUpdated(this); }