Java tutorial
//package com.java2s; //License from project: Apache License public class Main { public static String getUrlPath(String url) { return url.substring(0, url.lastIndexOf("/") + 1); } }