Here you can find the source of getParentPath(String absolutePath)
public static String getParentPath(String absolutePath)
//package com.java2s; import java.io.File; public class Main { public static String getParentPath(String absolutePath) { if (!isExist(absolutePath)) { return null; }//from www . j a v a 2 s . c om File file = new File(absolutePath); return file.getParent(); } public static boolean isExist(String path) { return new File(path).exists(); } }