private static boolean findRecursively(Entry entry, String targetName, int depth,
                                           int maxDepth) {
        if (entry == null) {
            return false;
        }
        if (entry.getName().toUpperCase(Locale.ROOT).equals(targetName)) {
            return true;
        }
        if (depth >= maxDepth) {
            return false;
        }
        if (entry instanceof DirectoryEntry) {
            for (Iterator<Entry> it = ((DirectoryEntry)entry).getEntries(); it.hasNext(); ) {
                Entry child = it.next();
                if (findRecursively(child, targetName, depth + 1, maxDepth)) {
                    return true;
                }
            }
        }
        return false;
    }
@param entry entry to search
@param targetName Upper cased target name
@param depth current depth
@param maxDepth maximum allowed depth
@return
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/detect/microsoft/POIFSContainerDetector.java