List of utility methods to do URL Decode
Map | decodeUrlFormEncoded(String data) decode Url Form Encoded HashMap<String, String> map = new HashMap<String, String>(); String d[] = data.split("&"); for (String s : d) { String t[] = s.split("="); String key = t[0]; String value = t[1]; map.put(key, value); return map; |
String | parseForHTTP(String str) This method reads a string and modifies it to support HTTP calls. String result = ""; for (int i = 0; i < str.length(); i++) { switch (str.charAt(i)) { case ' ': result += "%20"; break; case '<': result += "%3C"; ... |
String | parseLastfmUrl(String url) parse Lastfm Url if (url == null) { return null; String parsed = url.replaceAll(".*?www.last.fm/.*?/", ""); parsed = parsed.replaceAll("/.*", ""); String decoded = null; try { decoded = URLDecoder.decode(parsed, "UTF-8"); ... |
Bundle | parseUrl(String url) parse Url url = url.replace("rrconnect", "http"); url = url.replace("#", "?"); try { URL u = new URL(url); Bundle b = decodeUrl(u.getQuery()); b.putAll(decodeUrl(u.getRef())); return b; } catch (MalformedURLException e) { ... |
Bundle | parseUrl(String url) parse Url try { URL u = new URL(url); Bundle b = decodeUrl(u.getQuery()); b.putAll(decodeUrl(u.getRef())); return b; } catch (MalformedURLException e) { return new Bundle(); |
List | parserTrackURL(String trackURL) parser Track URL List<String> list = new ArrayList<String>(); StringTokenizer st = new StringTokenizer(trackURL, "&"); while (st.hasMoreTokens()) { String url = st.nextToken(); int index = url.indexOf("="); if (index > 0) { list.add(URLDecoder.decode( url.substring(index + 1, url.length()), HTTP.UTF_8)); ... |