Here you can find the source of parseQueryString(String queryString)
public static Map<String, List<String>> parseQueryString(String queryString)
//package com.java2s; //License from project: Apache License import java.net.URI; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.regex.Pattern; import java.util.stream.Collectors; import static java.util.stream.Collectors.toList; public class Main { private static final Pattern PATTERN_AND = Pattern.compile("&"); public static Map<String, List<String>> parseQueryString(URI uri) { return PATTERN_AND.splitAsStream(uri.getQuery()).map(s -> Arrays.copyOf(s.split("="), 2)) .collect(Collectors.groupingBy(s -> s[0], Collectors.mapping(s -> s[1], toList()))); }//from w w w . ja va 2s.co m public static Map<String, List<String>> parseQueryString(String queryString) { return PATTERN_AND.splitAsStream(queryString).map(s -> Arrays.copyOf(s.split("="), 2)) .collect(Collectors.groupingBy(s -> s[0], Collectors.mapping(s -> s[1], toList()))); } }