class FolderIndexer {

    public void indexFolder(final File file) {
        // do not try to index files that cannot be read
        if (file.canRead()) {
            if (file.isDirectory()) {
                processFolder(file);
            } else {
                fileIndexer.indexFile(file);
            }
        }
    }

}