@Override public FilePath getParent() { return wrap(base.getParent()); }
/** * Get the parent directory of a file or directory. This method returns null * if there is no parent. This method is similar to Java 7 * <code>java.nio.file.Path.getParent</code>. * * @param fileName the file or directory name * @return the parent directory name */ public static String getParent(String fileName) { FilePath p = FilePath.get(fileName).getParent(); return p == null ? null : p.toString(); }
FilePath parent = f.getParent(); if (parent != null && !parent.exists()) { throw DataUtils.newIllegalArgumentException("Directory does not exist: {0}", parent);