What if the file already exists you just want to read it?
The file doesn't have any content at the point you are reading it, regardless of whether or nor it did when you ran the program as the first thing you do is create a FileWriter() which overwrites any existing file. If you want to append to an existing file you need to create a FileWriter using the 2 parameter constructor with the second parameter being 'true'.

The NullPointerException is not because the file doesn't exist, it's because the readline() method returns null when the end of the file is reached. You are calling the equals() returned of the returned value without checking to see if it is null.