private void scanDirectory(LinkedHashMap<String, FileInfo> cacheMap, LinkedHashMap<String, FileInfo> newMap, File currentDir, Collection<File> created,
                               Collection<File> modified) {
        File[] children = currentDir.listFiles();
        if (children != null) {
            for (File child : children) {
                // depth first if we're recursing
                if (isRecursing() && child.isDirectory()) {
                    scanDirectory(cacheMap, newMap, child, created, modified);
                }

                boolean isFile = isFile(child);
                if (matches(child, isFile)) {
                    scanFile(cacheMap, newMap, child, created, modified, isFile);
                }
            }
        }
    }
private void scanDirectory ( LinkedHashMap < String , FileInfo > cacheMap , LinkedHashMap < String , FileInfo > newMap , File currentDir , Collection < File > created , Collection < File > modified ) { File [ ] children = currentDir . listFiles ( ) ; if ( children != null ) { for ( File child : children ) { if ( isRecursing ( ) && child . isDirectory ( ) ) { scanDirectory ( cacheMap , newMap , child , created , modified ) ; } boolean isFile = isFile ( child ) ; if ( matches ( child , isFile ) ) { scanFile ( cacheMap , newMap , child , created , modified , isFile ) ; } } } }
Scan the "current" directory: recursive method.
<p>
Assumes only one scan is active at a time.

@param cacheMap The map of file information from the previous scan
@param newMap The map of information for files/directories found in this scan
@param currentDir The current directory
@param created A list containing files that were not found in the previous scan
@param modified A list containing files whose attributes have changed since the previous scan