Well, I tested your code, and it did not throw any exception. The only problem I found is that you are not neither closing the stream nor flushing it, and that is why the Strings are not written into the file.
You must flush the out stream after writing the user or close the stream for all its data to be flushed into the file, or it will be kept in a temporary buffer until it is full.
Maybe you can print a strack trace when you catch the exception and tell us why you are having trouble with the file. Maybe you do not have reading or writing privileges on the operating system or another IO reason.
The Writer has another overloaded constructor:The 2nd boolean parameter indicates whether to append to file or not. If true, then stuff will just be appended if the file already exists, otherwise the file will just be overwritten.