/** * @see org.opencms.main.CmsRuntimeException#createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable) */ @Override public CmsRuntimeException createException(CmsMessageContainer container, Throwable cause) { return new CmsIllegalArgumentException(container, cause); } }
/** * Sets the content Age.<p> * * @param contentAge the content Age to set */ public void setContentAge(long contentAge) { if (contentAge < 0) { String ageString = Long.toString(contentAge); throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_BAD_CONTENT_AGE_1, ageString)); } m_contentAge = contentAge; }
/** * Sets the file path, should be a zip file.<p> * * @param path the file path */ public void setPath(String path) { if (CmsStringUtil.isEmpty(path) || !path.trim().equals(path)) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_BAD_FILE_NAME_1, path)); } m_path = path; }
/** * Sets the file path, should be a zip file.<p> * * @param path the file path */ public void setPath(String path) { if (CmsStringUtil.isEmpty(path) || !path.trim().equals(path)) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_BAD_FILE_NAME_1, path)); } m_path = path; }
/** * Sets the job name.<p> * * @param jobName the job name to set */ public void setJobName(String jobName) { checkFrozen(); if (CmsStringUtil.isEmpty(jobName) || !jobName.trim().equals(jobName)) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_BAD_JOB_NAME_1, jobName)); } m_jobName = jobName; }
/** * Sets the job name.<p> * * @param jobName the job name to set */ public void setJobName(String jobName) { checkFrozen(); if (CmsStringUtil.isEmpty(jobName) || !jobName.trim().equals(jobName)) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_BAD_JOB_NAME_1, jobName)); } m_jobName = jobName; }
/** * Sets the rfs export Path after normalizing.<p> * * @param exportPath the rfs export Path to set */ public void setExportPath(String exportPath) { if (exportPath.equals(OpenCms.getSystemInfo().getWebApplicationRfsPath())) { // not allowed because a full static export would delete the opencms directory throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_INVALID_EXPORT_PATH_1, m_name)); } m_exportPath = exportPath; }
/** * @see org.opencms.security.I_CmsValidationHandler#checkLastname(java.lang.String) */ public void checkLastname(String lastname) throws CmsIllegalArgumentException { if (CmsStringUtil.isEmptyOrWhitespaceOnly(lastname)) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_LASTNAME_EMPTY_0)); } }
/** * That means, the parameter should only be composed by digits and standard english letters.<p> * * @see org.opencms.security.I_CmsValidationHandler#checkZipCode(java.lang.String) */ public void checkZipCode(String zipcode) throws CmsIllegalArgumentException { if (!CmsStringUtil.validateRegex(zipcode, ZIPCODE_REGEX, true)) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_ZIPCODE_VALIDATION_1, zipcode)); } }
/** * Throws a runtime exception if name is empty.<p> * * @param name the project name to check */ public static void checkProjectName(String name) { if (CmsStringUtil.isEmptyOrWhitespaceOnly(name)) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_PROJECTNAME_VALIDATION_0)); } }
/** * Sets the description of this organizational unit.<p> * * @param description the principal organizational unit to set */ public void setDescription(String description) { if (CmsStringUtil.isEmptyOrWhitespaceOnly(description)) { throw new CmsIllegalArgumentException( org.opencms.db.Messages.get().container(org.opencms.db.Messages.ERR_BAD_OU_DESCRIPTION_EMPTY_0)); } m_description = description; }
/** * Checks if this modules configuration is frozen.<p> * * @throws CmsIllegalArgumentException in case the configuration is already frozen */ protected void checkFrozen() throws CmsIllegalArgumentException { if (m_frozen) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_MODULE_FROZEN_1, getName())); } }
/** * Sets the rfs export work Path after normalizing.<p> * * @param exportWorkPath the rfs export Work Path to set */ public void setExportWorkPath(String exportWorkPath) { if (exportWorkPath.equals(OpenCms.getSystemInfo().getWebApplicationRfsPath())) { // not allowed because a full static export would delete the opencms directory throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_INVALID_EXPORT_PATH_1, m_name)); } m_exportWorkPath = exportWorkPath; }
/** * Default Constructor.<p> * * @param id the unique id */ public CmsListColumnDefinition(String id) { if (CmsStringUtil.isEmptyOrWhitespaceOnly(id)) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_LIST_INVALID_NULL_ARG_1, "id")); } m_id = id; }
/** * Checks if this modules configuration is frozen.<p> * * @throws CmsIllegalArgumentException in case the configuration is already frozen */ protected void checkFrozen() throws CmsIllegalArgumentException { if (m_frozen) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_MODULE_FROZEN_1, getName())); } }
/** * @see org.opencms.security.I_CmsValidationHandler#checkLastname(java.lang.String) */ public void checkLastname(String lastname) throws CmsIllegalArgumentException { if (CmsStringUtil.isEmptyOrWhitespaceOnly(lastname)) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_LASTNAME_EMPTY_0)); } }
/** * @see org.opencms.workplace.list.I_CmsListAction#setListId(java.lang.String) */ public void setListId(String listId) { if (CmsStringUtil.isEmptyOrWhitespaceOnly(listId)) { throw new CmsIllegalArgumentException(Messages.get().container( Messages.ERR_LIST_INVALID_NULL_ARG_1, "listId")); } m_listId = listId; }
/** * Validates that the confirmation matches the new password.<p> */ public void validate() { if (CmsStringUtil.isEmpty(getNewPwd())) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_INVALID_NEWPWD_0)); } if (!getNewPwd().equals(getConfirmation())) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_NEWPWD_MISMATCH_0)); } } }
/** * Default Constructor.<p> * * @param id unique id */ public A_CmsListAction(String id) { super(id); if (CmsStringUtil.isEmptyOrWhitespaceOnly(id)) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_LIST_INVALID_NULL_ARG_1, "id")); } setConfirmationMessage(null); }
/** * Sets the message to display.<p> * * @param message the message to set */ public void setMessage(String message) { checkFrozen(); if (isEnabled() && CmsStringUtil.isEmptyOrWhitespaceOnly(message)) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_LOGIN_MESSAGE_BAD_MESSAGE_0)); } m_message = message; }