private static String sanitizeName ( String name ) { final String lowerCaseName = name . toLowerCase ( Locale . US ) ; final String separatorReplacedName = SANITIZE_TO_UNDERSCORE_PATTERN . matcher ( lowerCaseName ) . replaceAll ( UNDERSCORE ) ; return SANITIZE_REMOVE_PATTERN . matcher ( separatorReplacedName ) . replaceAll ( EMPTY_STRING ) ; }
converts to lowercase replaces common separators with underscores and strips all remaining non - alpha - numeric characters .