static void checkToken ( final String token , final String message , Object ... args ) { checkNotNull ( message , "Message cannot be null" ) ; try { validateLength ( token ) ; validateCharacters ( token ) ; } catch ( IllegalArgumentException e ) { throw new InvalidTokenException ( String . format ( message , args ) , token , e ) ; } }
Checks the given type name for illegal characters as defined in RFC 7230 section 3 . 2 . 6 .