Java Path Level getParentPath(String path)

Here you can find the source of getParentPath(String path)

Description

Get the parent path of a file.

License

Open Source License

Parameter

Parameter Description
path a parameter

Declaration

public static String getParentPath(String path) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.File;

public class Main {

    public static String getParentPath(String path) {
        String parentPath = null;
        File file = new File(path);
        parentPath = file.getParent();//from w  ww. j a  va  2  s .c om

        return parentPath;
    }
}

Related

  1. getParentPath(String path)