question: protected static String URLencodedSunQueryParamsString ( String queryParams , String encoding ) { StringBuilder sb = new StringBuilder ( 400 ) ; StringTokenizer st = new StringTokenizer ( queryParams , "&" ) ; while ( st . hasMoreTokens ( ) ) { String str = st . nextToken ( ) ; if ( str . indexOf ( "=" ) != - 1 ) { int index = str . indexOf ( "=" ) ; String parameter = str . substring ( 0 , index ) ; String value = str . substring ( index + 1 ) ; if ( parameter . equalsIgnoreCase ( "realm" ) || parameter . equalsIgnoreCase ( "org" ) || parameter . equalsIgnoreCase ( "module" ) ) { value = getCharDecodedField ( value , encoding ) ; } sb . append ( URLEncDec . encode ( parameter ) ) ; sb . append ( "=" ) ; sb . append ( URLEncDec . encode ( value ) ) ; if ( st . hasMoreTokens ( ) ) { sb . append ( "&" ) ; } } } return sb . toString ( ) ; }
target:  This method takes in a String representing base64 decoded  SunQueryParamsString and URL encodes all the parameters included in its value