Here you can find the source of splitQuery(String query)
private static Map<String, String> splitQuery(String query) throws UnsupportedEncodingException
//package com.java2s; //License from project: Open Source License import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.HashMap; import java.util.Map; public class Main { private static Map<String, String> splitQuery(String query) throws UnsupportedEncodingException { if (query == null || query.isEmpty()) { return new HashMap<>(); } else {//from w w w. j av a 2 s.c o m String[] params = query.split("&"); Map<String, String> map = new HashMap<>(); for (String param : params) { String[] split = param.split("="); map.put(URLDecoder.decode(split[0], "UTF-8"), URLDecoder.decode(split.length > 1 ? split[1] : "", "UTF-8")); } return map; } } }