Here you can find the source of getParentPath(File file, boolean wrap, boolean escape)
public static String getParentPath(File file, boolean wrap, boolean escape)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static String getParentPath(File file, boolean wrap, boolean escape) { if (file.getParent() != null) { return wrapAndEscape(file.getParentFile().getAbsolutePath(), wrap, escape); } else {//www . j a v a 2 s. com return null; } } private static String wrapAndEscape(String string, boolean wrap, boolean escape) { if (escape) { string = string.replaceAll(" ", "\\\\ "); } if (wrap) { string = "\"" + string + "\""; } return string; } }