Q:

Java - Best way to open a ton a files and search for a word? 

I am searching a directory with about 450 files, each file around 20kb.  Here is my method:
public void search(String searchWord) throws IOException
{
    this.directoryPath = FileSystems.getDefault().getPath(this.directoryString);
    this.fileListStream = Files.newDirectoryStream(this.directoryPath);
    int fileCount = 0;
    for(Path path : this.fileListStream)
    {
        String fileName = path.getFileName().toString();
        if(!fileName.startsWith(".")) 
        {
            BufferedReader br = Files.newBufferedReader(path, Charset.defaultCharset());
            String line;
            while((line = br.readLine()) ! = null)
            {
                System.out.println(fileName + ": " + line);
            }
            fileCount++;
            br.close();
        }
    }

    System.out.println("File Count: " + fileCount);
}

My goal is to go word by word and find a match for searchWord and print out the line number and the file name it was found in.  
My problem is that I'm wondering if I should split the line into an array and search the array for the word and add it to a list.  Or should I scan the entire file into an array of words and then search for the words and add them to a list?  Or does it even matter?  Also, if there is a better way to do this, please let me know!  I'm trying to do this as efficient as possible due to limited resources. 

A:

You shouldn't be looking word-by-word, just read the entire line as a String and then use String.indexOf() method to find if the line contains the word or not.