public static String cleanseToken ( String token ) { if ( token == null || token . length ( ) == 0 ) { return token ; } ; String cleansed = token . replaceAll ( SPACE , UNDERSCORE ) ; cleansed = cleansed . replaceAll ( Constants . SEP , UNDERSCORE ) ; return cleansed ; }
Takes a string token to be used as a key or qualifier and cleanses out reserved tokens . This operation is not symetrical . Logic is to replace all spaces and exclamation points with underscores .