Here you can find the source of getParentPath(String path)
Parameter | Description |
---|---|
path | a parameter |
public static String getParentPath(String path)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**//from ww w .ja va 2 s . c o m * Convenience method to get the Path to the folder containing * the file or directory in the supplied path. * @param path * @return path to parent */ public static String getParentPath(String path) { try { return new File(path).getParent(); } catch (Exception e) { e.printStackTrace(); } return null; } }