protected File[] listDirectory(File dir) {
        File[] files = dir.listFiles();
        if (files == null) {
            if (LOGGER.isInfoEnabled()) {
                LOGGER.info("Could not retrieve contents of directory [{}]", dir.getAbsolutePath());
            }
            return new File[0];
        }
        Arrays.sort(files, Comparator.comparing(File::getName));
        return files;
    }
Determine a sorted list of files in the given directory.

@param dir the directory to introspect
@return the sorted list of files (by default in alphabetical order)
see File#listFiles()
@since 5.1
analyzer/src/main/java/nl/basjes/parse/useragent/utils/springframework/core/io/support/PathMatchingResourcePatternResolver.java