Here you can find the source of parseQuery(URI uri)
private static Map<String, List<String>> parseQuery(URI uri) throws UnsupportedEncodingException
//package com.java2s; import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URLDecoder; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; public class Main { private static Map<String, List<String>> parseQuery(URI uri) throws UnsupportedEncodingException { Map<String, List<String>> query_pairs = new LinkedHashMap<String, List<String>>(); String query = uri.getQuery(); if (query == null) return new HashMap<String, List<String>>(); String[] pairs = query.split("&"); for (String pair : pairs) { int idx = pair.indexOf("="); String v = URLDecoder.decode(pair.substring(idx + 1), "UTF-8"); String k = URLDecoder.decode(pair.substring(0, idx), "UTF-8"); List<String> l = query_pairs.get(k); if (l == null) { l = new ArrayList<String>(); query_pairs.put(k, l);/*from www . j av a2 s .co m*/ } l.add(v); } return query_pairs; } }