public static HttpParameters decodeForm(String form){
  HttpParameters params=new HttpParameters();
  if (isEmpty(form)) {
    return params;
  }
  for (  String nvp : form.split("\\&")) {
    int equals=nvp.indexOf('=');
    String name;
    String value;
    if (equals < 0) {
      name=percentDecode(nvp);
      value=null;
    }
 else {
      name=percentDecode(nvp.substring(0,equals));
      value=percentDecode(nvp.substring(equals + 1));
    }
    params.put(name,value);
  }
  return params;
}

public static HttpParameters decodeForm ( String form ) { HttpParameters params = new HttpParameters ( ) ; if ( isEmpty ( form ) ) { return params ; } for ( String nvp : form . split ( "\\&" ) ) { int equals = nvp . indexOf ( '=' ) ; String name ; String value ; if ( equals < 0 ) { name = percentDecode ( nvp ) ; value = null ; } else { name = percentDecode ( nvp . substring ( 0 , equals ) ) ; value = percentDecode ( nvp . substring ( equals + 1 ) ) ; } params . put ( name , value ) ; } return params ; }
parse a form - urlencoded document .
