private static Map < String , String > splitCookieToken ( String tokenStr ) { Map < String , String > map = new HashMap < String , String > ( ) ; StringTokenizer st = new StringTokenizer ( tokenStr , COOKIE_ATTR_SEPARATOR ) ; while ( st . hasMoreTokens ( ) ) { String part = st . nextToken ( ) ; int separator = part . indexOf ( COOKIE_KEY_VALUE_SEPARATOR ) ; if ( separator == - 1 ) { LOG . error ( "Invalid token string " + tokenStr ) ; return null ; } String key = part . substring ( 0 , separator ) ; String value = part . substring ( separator + 1 ) ; map . put ( key , value ) ; } return map ; }
Splits the cookie token into attributes pairs .