Here you can find the source of isParent(Path parent, Path path)
public static boolean isParent(Path parent, Path path)
//package com.java2s; //License from project: Open Source License import java.nio.file.Path; public class Main { public static boolean isParent(Path parent, Path path) { while ((path = path.getParent()) != null) { if (path.equals(parent)) { return true; }/* w w w . j a v a2 s . co m*/ } return false; } }