Here you can find the source of parseQueryParameters( String query)
public final static Map<String, String> parseQueryParameters( String query)
//package com.java2s; // Licensed to the Apache Software Foundation (ASF) under one import java.net.URI; import java.net.URL; import java.util.HashMap; import java.util.Map; public class Main { public final static Map<String, String> parseQueryParameters( String query) {//from w w w .j a v a 2s . co m HashMap<String, String> values = new HashMap<String, String>(); parseQueryParameters(query, false, values); return values; } public final static Map<String, String> parseQueryParameters(URL url) { return parseQueryParameters(url.getQuery()); } public final static Map<String, String> parseQueryParameters(URI url) { return parseQueryParameters(url.getQuery()); } public final static void parseQueryParameters(String query, boolean lowercaseKeys, Map<String, String> params) { if (query == null) { return; } if (query.startsWith("?")) { query = query.substring(1); } String[] parts = query.split("&"); for (String part : parts) { String[] tokens = part.split("="); if (lowercaseKeys) { tokens[0] = tokens[0].toLowerCase(); } params.put(tokens[0], tokens[1]); } } }