Android URL Decode parseLastfmUrl(String url)

Here you can find the source of parseLastfmUrl(String url)

Description

parse Lastfm Url

Declaration

public static String parseLastfmUrl(String url) 

Method Source Code

//package com.java2s;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

public class Main {
    public static String parseLastfmUrl(String url) {
        if (url == null) {
            return null;
        }/* w  w  w .java 2  s.c  o  m*/

        String parsed = url.replaceAll(".*?www.last.fm/.*?/", "");
        parsed = parsed.replaceAll("/.*", "");

        String decoded = null;
        try {
            decoded = URLDecoder.decode(parsed, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }

        return decoded;
    }
}

Related

  1. decode(String s)
  2. decodeUrl(String s)
  3. decodeUrl(String s)
  4. decodeUrlFormEncoded(String data)
  5. parseForHTTP(String str)
  6. parseUrl(String url)
  7. parseUrl(String url)
  8. parserTrackURL(String trackURL)