Here you can find the source of parseParameters( Optional
public static Map<String, String[]> parseParameters( Optional<String> queryString)
//package com.java2s; /* (c) 2016 Open Source Geospatial Foundation - all rights reserved * This code is licensed under the GPL 2.0 license, available at the root * application directory.//from w w w .jav a 2 s . co m */ import java.net.URLDecoder; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.Optional; public class Main { public static Map<String, String[]> parseParameters( Optional<String> queryString) { Map<String, String[]> parameters = new HashMap<>(); if (!queryString.isPresent()) { return parameters; } final String[] parametersParts = queryString.get().split("&"); for (String parametersPart : parametersParts) { String[] parameterParts = parametersPart.split("="); if (parameterParts.length < 2) { continue; } String name = URLDecoder.decode(parameterParts[0]); String value = URLDecoder.decode(parameterParts[1]); String[] values = parameters.get(name); if (values == null) { parameters.put(name, new String[] { value }); } else { values = Arrays.copyOf(values, value.length() + 1); values[value.length()] = value; parameters.put(name, values); } } return parameters; } }