Here you can find the source of decode(String str)
static public Properties decode(String str)
//package com.java2s; /*/*from w ww . ja v a2 s . c o m*/ * Flash and Java activities in Moodle * http://sourceforge.net/projects/flashjavamoodle/ * * Copyright (C) 2011 Departament d'Ensenyament de la Generalitat de Catalunya * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation. */ import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.Properties; import java.util.StringTokenizer; public class Main { static public Properties decode(String str) { try { StringTokenizer st = new StringTokenizer(str, "&"); Properties prop = new Properties(); while (st.hasMoreElements()) { String t = st.nextToken(); int i = t.indexOf("="); if (i > 0) { String key = t.substring(0, i); String dkey = URLDecoder.decode(key, "utf-8"); String value = t.substring(i + 1); String dvalue = URLDecoder.decode(value, "utf-8"); prop.put(dkey, dvalue); } } return prop; } catch (UnsupportedEncodingException f) { throw new Error(f); } } }