Java Parent Path Get getParentPath(String fullpath)

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

Description

get Parent Path

License

Open Source License

Declaration

public static String getParentPath(String fullpath) 

Method Source Code


//package com.java2s;
import java.io.File;

public class Main {
    public static String getParentPath(String fullpath) {
        File file = new File(fullpath);

        if (file == null) {
            return "";
        }/*ww w  .  j  a v  a  2s .c  o  m*/

        if (file.getParentFile() == null) {
            return "";
        }

        return file.getParentFile().getPath();
    }
}

Related

  1. getParentPath()
  2. getParentPath(File file, boolean wrap, boolean escape)
  3. getParentPath(String absolutePath)
  4. getParentPath(String filePath)
  5. getParentPath(String path)
  6. getParentPath(String path)
  7. getParentPathAndName(String path, StringBuilder parent)
  8. getParentPathname(String pathname)