code: public static Map<String, String> parseQueryParameters( String rawQuery )
      {
          Map<String, String> ret = new LinkedHashMap<String, String>();
          if ( rawQuery == null || rawQuery.length() == 0 ) {
              return ret;
          }
          try {
              String[] pairs = rawQuery.split( "&" );
              for ( String pair : pairs ) {
                  int idx = pair.indexOf( "=" );
                  String name;
                  String value;
                  if ( idx > 0 ) {
                      // name=value
                      name = pair.substring( 0, idx );
                      value = URLDecoder.decode( pair.substring( idx + 1 ), PcsUtils.UTF8.name() );
                  } else if ( idx < 0 ) {
                      // name (no value)
                      name = pair;
                      value = null;
                  } else {
                      // =value ?? we ignore this
                      name = null;
                      value = null;
                  }
                  if ( name != null ) {
                      ret.put( name, value );
                  }
              }
  
              return ret;
          } catch ( UnsupportedEncodingException ex ) {
              throw new RuntimeException( ex );
          }
      }
docs: Parse a query param string into a map of parameters.
  
  Duplicated parameters cannot be handled by this method. Parameters names not followed by '=' sign are only keys
  but have null value. Parameters names followed by '=' sign have an empty string value.
  
  @param rawQuery The query param string, as returned by URI.getRawQuery() (UTF-8 charset)
  @return a (mutable) map of parameters (empty map if rawQuery is null or empty). Order of parameters is kept.