private static String escapeDoubleQuotes ( String s , int beginIndex , int endIndex ) { if ( s == null || s . length ( ) == 0 || s . indexOf ( ' ' ) == - 1 ) { return s ; } StringBuilder b = new StringBuilder ( ) ; for ( int i = beginIndex ; i < endIndex ; i ++ ) { char c = s . charAt ( i ) ; if ( c == ' ' ) { b . append ( c ) ; //ignore the character after an escape, just append it if ( ++ i >= endIndex ) throw UndertowMessages . MESSAGES . invalidEscapeCharacter ( ) ; b . append ( s . charAt ( i ) ) ; } else if ( c == ' ' ) b . append ( ' ' ) . append ( ' ' ) ; else b . append ( c ) ; } return b . toString ( ) ; }
Escapes any double quotes in the given string .