Java Utililty Methods Path Level

List of utility methods to do Path Level

Description

The list of methods to do Path Level are organized into topic(s).

Method

StringgetParentPath(String path)
Get the parent path of a file.
String parentPath = null;
File file = new File(path);
parentPath = file.getParent();
return parentPath;
StringgetParentPath(String path)
Extracts the parent of a file
int pos = path.lastIndexOf(File.separator);
if (pos <= 0) {
    return null;
return path.substring(0, pos);