From java docs
public FileWriter(String fileName) throws IOException
Throws:
IOException - if the named file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
and here
public FileOutputStream(File file, boolean append) throws FileNotFoundException
Throws:
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
Is there a specific reason for this choice?