import java.io.File;
class Main {
public static void main
(String[] args
) { File theFile
= new File("/sdcard/images/mr.32.png"); System.
out.
println("Parent : " + theFile.
getParent()); String path
= "/sdcard/images/mr.32.png"; String parent
= path.
replaceAll("^(.*)/.*?$",
"$1"); System.
out.
println("Parent : " + parent
); }
}
aW1wb3J0IGphdmEuaW8uRmlsZTsKCmNsYXNzIE1haW4gewogICAgICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKICAgICAgICAgICAgICAgIEZpbGUgdGhlRmlsZSA9IG5ldyBGaWxlKCIvc2RjYXJkL2ltYWdlcy9tci4zMi5wbmciKTsKICAgICAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiUGFyZW50IDogIiArIHRoZUZpbGUuZ2V0UGFyZW50KCkpOwogICAgICAgICAgICAgICAgU3RyaW5nIHBhdGggPSAiL3NkY2FyZC9pbWFnZXMvbXIuMzIucG5nIjsKICAgICAgICAgICAgICAgIFN0cmluZyBwYXJlbnQgPSBwYXRoLnJlcGxhY2VBbGwoIl4oLiopLy4qPyQiLCIkMSIpOwogICAgICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJQYXJlbnQgOiAiICsgcGFyZW50KTsKICAgICAgICB9Cn0K