The Java 7 docs for FileWriter and FileOutputStream show that the FileWriter constructor throws an IOException, and the FileOutputStream constructor throws a FileNotFoundException.
The reason for both exceptions is the same. It says: "If the file exists, but is a directory, not a regular file, it does not exist, but cannot be created or cannot be opened for any other reason."
If so, why are the specialized exception for FileOutputStream and the general exception for FileWriter solved by Java developers?
source share