private static void checkQuotedString ( final String quotedString ) { boolean quotedPair = false ; for ( int i = 0 ; i < quotedString . length ( ) ; i ++ ) { final char ch = quotedString . charAt ( i ) ; if ( quotedPair ) { checkArgument ( QUOTED_PAIR . get ( ch ) , "Invalid quoted-pair character '%s' in quoted string '%s' at %d" , ch , quotedString , i ) ; quotedPair = false ; } else if ( ch == SLASH ) { quotedPair = true ; } else { checkArgument ( QDTEXT . get ( ch ) , "Invalid character '%s' in quoted string '%s' at %d" , ch , quotedString , i ) ; } } checkArgument ( ! quotedPair , "Missing quoted-pair character in quoted string '%s' at %d" , quotedString , quotedString . length ( ) ) ; }
Checks the given quoted string for illegal characters as defined in RFC 7230 section 3 . 2 . 6 .