/** * A user name can only be composed of digits, * standard ASCII letters and the symbols defined in {@link #USERNAME_CONSTRAINTS}.<p> * * @see org.opencms.security.I_CmsValidationHandler#checkUserName(java.lang.String) */ public void checkUserName(String userName) throws CmsIllegalArgumentException { if (CmsStringUtil.isEmptyOrWhitespaceOnly(userName)) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_BAD_USERNAME_EMPTY_0, userName)); } CmsStringUtil.checkName(userName, USERNAME_CONSTRAINTS, Messages.ERR_BAD_USERNAME_4, Messages.get()); }
/** * A user name can only be composed of digits, * standard ASCII letters and the symbols defined in {@link #USERNAME_CONSTRAINTS}.<p> * * @see org.opencms.security.I_CmsValidationHandler#checkUserName(java.lang.String) */ public void checkUserName(String userName) throws CmsIllegalArgumentException { if (CmsStringUtil.isEmptyOrWhitespaceOnly(userName)) { throw new CmsIllegalArgumentException( Messages.get().container(Messages.ERR_BAD_USERNAME_EMPTY_0, userName)); } CmsStringUtil.checkName(userName, USERNAME_CONSTRAINTS, Messages.ERR_BAD_USERNAME_4, Messages.get()); }
/** * Checks if the provided property name is a valid property name, * that is contains only valid characters.<p> * * A property name can only be composed of digits, * standard ASCII letters and the symbols defined in {@link #NAME_CONSTRAINTS}.<p> * * @param name the property name to check * * @throws CmsIllegalArgumentException if the given property name is not valid */ public static void checkPropertyName(String name) throws CmsIllegalArgumentException { if (CmsStringUtil.isEmptyOrWhitespaceOnly(name)) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_BAD_PROPERTYNAME_EMPTY_0, name)); } CmsStringUtil.checkName(name, NAME_CONSTRAINTS, Messages.ERR_BAD_PROPERTYNAME_4, Messages.get()); }
/** * Checks if the provided property name is a valid property name, * that is contains only valid characters.<p> * * A property name can only be composed of digits, * standard ASCII letters and the symbols defined in {@link #NAME_CONSTRAINTS}.<p> * * @param name the property name to check * * @throws CmsIllegalArgumentException if the given property name is not valid */ public static void checkPropertyName(String name) throws CmsIllegalArgumentException { if (CmsStringUtil.isEmptyOrWhitespaceOnly(name)) { throw new CmsIllegalArgumentException( Messages.get().container(Messages.ERR_BAD_PROPERTYNAME_EMPTY_0, name)); } CmsStringUtil.checkName(name, NAME_CONSTRAINTS, Messages.ERR_BAD_PROPERTYNAME_4, Messages.get()); }
/** * Commits the edited search index to the search manager.<p> */ @Override public void actionCommit() { List<Throwable> errors = new ArrayList<Throwable>(); try { // if new create it first if (!m_searchManager.getSearchIndexesAll().contains(m_index)) { // check the index name for invalid characters CmsStringUtil.checkName( m_index.getName(), INDEX_NAME_CONSTRAINTS, Messages.ERR_SEARCHINDEX_BAD_INDEXNAME_4, Messages.get()); // empty or null name and uniqueness check in add method m_searchManager.addSearchIndex(m_index); } // check if field configuration has been updated, if thus set field configuration to the now used if (!m_index.getFieldConfigurationName().equals(m_index.getFieldConfiguration().getName())) { m_index.setFieldConfiguration( m_searchManager.getFieldConfiguration(m_index.getFieldConfigurationName())); } writeConfiguration(); } catch (Throwable t) { errors.add(t); } // set the list of errors to display when saving failed setCommitErrors(errors); }
CmsStringUtil.checkName(name, NAME_CONSTRAINTS, Messages.ERR_BAD_RESOURCENAME_4, Messages.get());
CmsStringUtil.checkName(name, NAME_CONSTRAINTS, Messages.ERR_BAD_RESOURCENAME_4, Messages.get());