Here you can find the source of parse_parameters(String input)
public static Map<String, List<String>> parse_parameters(String input) throws UnsupportedEncodingException
//package com.java2s; /**/*from w w w .j ava2 s . c o m*/ * Class to provide %OAuth utility methods * * @copyright Andy Smith * @version 2008-08-04 * @license https://opensource+org/licenses/MIT The MIT License */ import java.util.List; import java.util.Map; import java.util.LinkedHashMap; import java.util.LinkedList; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; public class Main { public static Map<String, List<String>> parse_parameters(String input) throws UnsupportedEncodingException { final Map<String, List<String>> query_pairs = new LinkedHashMap<String, List<String>>(); final String[] pairs = input.split("&"); for (String pair : pairs) { final int idx = pair.indexOf("="); final String key = idx > 0 ? URLDecoder.decode( pair.substring(0, idx), "UTF-8") : pair; if (!query_pairs.containsKey(key)) { query_pairs.put(key, new LinkedList<String>()); } final String value = idx > 0 && pair.length() > idx + 1 ? URLDecoder .decode(pair.substring(idx + 1), "UTF-8") : null; query_pairs.get(key).add(value); } return query_pairs; } }