public static Map<String,String> parseQueryString(String queryString){
  StringBuilder query=new StringBuilder(queryString);
  Map<String,String> hash=new HashMap<String,String>();
  while (query.length() > 0) {
    char c=query.charAt(0);
    if (c == '&') {
      query.deleteCharAt(0);
      continue;
    }
    int equals=query.indexOf("=");
    String key=query.substring(0,equals);
    String value;
    query.delete(0,equals + 1);
    if (query.charAt(0) == '\"') {
      int nextQuote=query.indexOf("\"",1);
      if (nextQuote == -1) {
        value=query.toString();
        query.delete(0,query.length());
      }
 else {
        value=query.substring(1,nextQuote);
        query.delete(0,nextQuote + 1);
      }
    }
 else {
      int ampIndex=query.indexOf("&");
      if (ampIndex == -1) {
        ampIndex=query.length();
      }
      value=query.substring(0,ampIndex);
      query.delete(0,ampIndex);
    }
    hash.put(key,value);
  }
  return hash;
}

public static Map < String , String > parseQueryString ( String queryString ) { StringBuilder query = new StringBuilder ( queryString ) ; Map < String , String > hash = new HashMap < String , String > ( ) ; while ( query . length ( ) > 0 ) { char c = query . charAt ( 0 ) ; if ( c == '&' ) { query . deleteCharAt ( 0 ) ; continue ; } int equals = query . indexOf ( "=" ) ; String key = query . substring ( 0 , equals ) ; String value ; query . delete ( 0 , equals + 1 ) ; if ( query . charAt ( 0 ) == '\"' ) { int nextQuote = query . indexOf ( "\"" , 1 ) ; if ( nextQuote == - 1 ) { value = query . toString ( ) ; query . delete ( 0 , query . length ( ) ) ; } else { value = query . substring ( 1 , nextQuote ) ; query . delete ( 0 , nextQuote + 1 ) ; } } else { int ampIndex = query . indexOf ( "&" ) ; if ( ampIndex == - 1 ) { ampIndex = query . length ( ) ; } value = query . substring ( 0 , ampIndex ) ; query . delete ( 0 , ampIndex ) ; } hash . put ( key , value ) ; } return hash ; }
parse a query string using the ' & ' character as the delimiter . handles quoted values and is thus different than httputils . parsequerystring .
