return path.substring(0, index - 1);
return path.substring(0, index);
    public static String removeTail(String path) {        int index = path.length() - 1;        while(index >= 0) {            if (path.charAt(index) == '/') {                return path.substring(0, index - 1);             }            index--;        }        return "";    }