static StringBuilder appendQuotedString ( StringBuilder target , String key ) { target . append ( ' ' ) ; for ( int i = 0 , len = key . length ( ) ; i < len ; i ++ ) { char ch = key . charAt ( i ) ; switch ( ch ) { case ' ' : target . append ( "%0A" ) ; break ; case ' ' : target . append ( "%0D" ) ; break ; case ' ' : target . append ( "%22" ) ; break ; default : target . append ( ch ) ; break ; } } target . append ( ' ' ) ; return target ; }
Appends a quoted - string to a StringBuilder .