The name of a Content Object is checked by a [Regular Expression][1]: `[\\p{Alnum}_-]+[\\p{Alnum}_.+\\-]*`**`[\\p{Alnum}_-]+[\\p{Alnum}_.+\\-]*`**
Here an example of an utility class
package cms.utils;
import java.util.regex.Pattern;
public class CmsUtils {
private CmsUtils(){}
private static final Pattern CMS_NAME_FORMAT = Pattern.compile("[\\p{Alnum}_-]+[\\p{Alnum}_.+\\-]*");
public static boolean isContentObjectNameValid(String name) {
return CMS_NAME_FORMAT.matcher(name).matches();
}
}
[1]: http://en.wikipedia.org/wiki/Regular_expression