@Deprecated
    public static boolean checkThisIsAncestorOfThat(File ancestor, File child) {
        int ancLen = ancestor
                .getAbsolutePath()
                .length();
        int childLen = child
                .getAbsolutePath()
                .length();
        if (childLen <= ancLen) {
            return false;
        }

        String childBase = child
                .getAbsolutePath()
                .substring(0, ancLen);
        return childBase.equals(ancestor.getAbsolutePath());

    }
Utility class to handle some common issues when
reading from and writing to a file system (FS).
tika-batch/src/main/java/org/apache/tika/batch/fs/FSUtil.java