Java tutorial
//package com.java2s; import android.text.TextUtils; public class Main { public static String getFolderPath(String path) { String folderPath = ""; if (!TextUtils.isEmpty(path)) { int i = path.lastIndexOf('/'); if (i > 0) { folderPath = path.substring(0, i); } } return folderPath; } }