code: public static boolean isSubPath(File parent, File child) throws IOException {
      String childStr = child.getCanonicalPath();
      String parentStr = parent.getCanonicalPath();
  
      return childStr.startsWith(parentStr);
    }
docs: *
  Check if child path is child of parent path.
  @param parent Expected parent path.
  @param child Expected child path.
  @return If child path is child of parent path.
  @throws IOException