Here you can find the source of splitQuery(URL url)
public static Map<String, String> splitQuery(URL url) throws UnsupportedEncodingException
//package com.java2s; //License from project: Open Source License import java.net.URL; import java.net.URLDecoder; import java.util.*; import java.io.UnsupportedEncodingException; public class Main { public static Map<String, String> splitQuery(URL url) throws UnsupportedEncodingException { Map<String, String> queryPairs = new LinkedHashMap<String, String>(); String query = url.getQuery(); String[] pairs = query.split("&"); for (String pair : pairs) { int idx = pair.indexOf("="); String key = URLDecoder.decode(pair.substring(0, idx), "UTF-8"); if (queryPairs.get(key) == null) { queryPairs.put(key, URLDecoder.decode(pair.substring(idx + 1), "UTF-8")); } else { queryPairs.put(key,//from ww w .ja va2s . c om queryPairs.get(key) + ", " + URLDecoder.decode(pair.substring(idx + 1), "UTF-8")); } } return queryPairs; } }