Java Parent Path Get getParentPath(String absolutePath)

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

Description

get Parent Path

License

Open Source License

Declaration

public static String getParentPath(String absolutePath) 

Method Source Code

//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();
    }
}

Related

  1. getParentPath()
  2. getParentPath(File file, boolean wrap, boolean escape)
  3. getParentPath(String filePath)
  4. getParentPath(String fullpath)
  5. getParentPath(String path)
  6. getParentPath(String path)