public static String addParametersToURIQuery(String uriString, Map<String, String> parameters) { if (uriString == null || parameters == null || parameters.isEmpty()) { return uriString; } String uriPath = getURIPath(uriString); Map<String, String> existingParams = getRequestParameters(uriString.substring(uriPath.length())); if (existingParams == null) { existingParams = new LinkedHashMap<>(); } existingParams.putAll(parameters); String res; if (!existingParams.isEmpty()) { String newQuery = getURIQuery(existingParams); res = uriPath + '?' + newQuery; } else { res = uriPath; } return res; }
String uri = URIUtils.getURIPath(requestPage);