public static String getUrlPath(String url) {
        Pattern pattern = Pattern.compile("^https?://([^/]+)/?(.*?)([^/]*?)$");
        Matcher matcher = pattern.matcher(url);
        String m1 = "";
        String m2 = "";
        if (matcher.matches()) {
            m1 = matcher.group(1);
            m2 = matcher.group(2);
            if (m2.length() > 0 && m2.charAt(m2.length()-1) == '/') {
                return m1 + "/" + m2;
            }
            return m1 + "/";
        }
        return "";
    }