Here you can find the source of getQueryMap(String query)
private static Map<String, String> getQueryMap(String query)
//package com.java2s; //License from project: Open Source License import java.io.*; import java.net.URLDecoder; import java.util.*; public class Main { private static Map<String, String> getQueryMap(String query) { String[] params = query.split("&"); Map<String, String> map = new HashMap<>(); for (String param : params) { String name = null;/* w ww . j ava2 s . c o m*/ final String[] paramParts = param.split("="); try { name = URLDecoder.decode(paramParts[0], "utf-8"); } catch (UnsupportedEncodingException e) { // Impossible } String value = null; try { value = URLDecoder.decode(paramParts[1], "utf-8"); } catch (UnsupportedEncodingException e) { // Impossible } map.put(name, value); } return map; } }