protected void doRetrieveMatchingFiles(String fullPattern, File dir, Set<File> result) throws IOException {
        if (LOGGER.isTraceEnabled()) {
            LOGGER.trace("Searching directory [{}] for files matching pattern [{}]", dir.getAbsolutePath(), fullPattern);
        }
        for (File content : listDirectory(dir)) {
            String currPath = StringUtils.replace(content.getAbsolutePath(), File.separator, "/");
            if (content.isDirectory() && getPathMatcher().matchStart(fullPattern, currPath + "/")) {
                if (!content.canRead()) {
                    if (LOGGER.isDebugEnabled()) {
                        LOGGER.debug("Skipping subdirectory [{}] because the application is not allowed to read the directory", dir.getAbsolutePath());
                    }
                } else {
                    doRetrieveMatchingFiles(fullPattern, content, result);
                }
            }
            if (getPathMatcher().match(fullPattern, currPath)) {
                result.add(content);
            }
        }
    }
Recursively retrieve files that match the given pattern,
adding them to the given result list.

@param fullPattern the pattern to match against,
                   with prepended root directory path
@param dir         the current directory
@param result      the Set of matching File instances to add to
@throws IOException if directory contents could not be retrieved
analyzer/src/main/java/nl/basjes/parse/useragent/utils/springframework/core/io/support/PathMatchingResourcePatternResolver.java