@Test public void testParseQueryString() throws UnsupportedEncodingException { final String queryString = "param1=value1&param2=value2=3&param3=value%3D3&param4=value%264"; Map<String, String> queryMap = QCParser.parseQueryString(queryString); assertEquals("value1", queryMap.get("param1")); assertEquals("value2=3", queryMap.get("param2")); assertEquals("value=3", queryMap.get("param3")); assertEquals("value&4", queryMap.get("param4")); }
public static Map<String, String> parseQueryString(String queryStr) throws UnsupportedEncodingException { List<String> paramList = Arrays.asList(queryStr.split("&")); Map<String, String> parameters = new HashMap<String,String>(); for (String param : paramList) { String[] paramArray = param.split("=", 2); parameters.put(URLDecoder.decode(paramArray[0], "UTF-8"), URLDecoder.decode(paramArray[1], "UTF-8")); } return parameters; }
QCParser { public static Map<String, String> parseQueryString(String queryStr) throws UnsupportedEncodingException { List<String> paramList = Arrays.asList(queryStr.split("&")); Map<String, String> parameters = new HashMap<String,String>(); for (String param : paramList) { String[] paramArray = param.split("=", 2); parameters.put(URLDecoder.decode(paramArray[0], "UTF-8"), URLDecoder.decode(paramArray[1], "UTF-8")); } return parameters; } }
QCParser { public static Map<String, String> parseQueryString(String queryStr) throws UnsupportedEncodingException { List<String> paramList = Arrays.asList(queryStr.split("&")); Map<String, String> parameters = new HashMap<String,String>(); for (String param : paramList) { String[] paramArray = param.split("=", 2); parameters.put(URLDecoder.decode(paramArray[0], "UTF-8"), URLDecoder.decode(paramArray[1], "UTF-8")); } return parameters; }  }
QCParser { public static Map<String, String> parseQueryString(String queryStr) throws UnsupportedEncodingException { List<String> paramList = Arrays.asList(queryStr.split("&")); Map<String, String> parameters = new HashMap<String,String>(); for (String param : paramList) { String[] paramArray = param.split("=", 2); parameters.put(URLDecoder.decode(paramArray[0], "UTF-8"), URLDecoder.decode(paramArray[1], "UTF-8")); } return parameters; }  static GuacamoleConfiguration getConfiguration(String uri); static Map<String, String> parseQueryString(String queryStr); static void parseUserInfo(String userInfo, 
            GuacamoleConfiguration config); static String getName(GuacamoleConfiguration config); }
QCParser { public static Map<String, String> parseQueryString(String queryStr) throws UnsupportedEncodingException { List<String> paramList = Arrays.asList(queryStr.split("&")); Map<String, String> parameters = new HashMap<String,String>(); for (String param : paramList) { String[] paramArray = param.split("=", 2); parameters.put(URLDecoder.decode(paramArray[0], "UTF-8"), URLDecoder.decode(paramArray[1], "UTF-8")); } return parameters; }  static GuacamoleConfiguration getConfiguration(String uri); static Map<String, String> parseQueryString(String queryStr); static void parseUserInfo(String userInfo, 
            GuacamoleConfiguration config); static String getName(GuacamoleConfiguration config);  }