I get the following IOException :
java.io.IOException: Access is denied at java.io.WinNTFileSystem.createFileExclusively(Native Method) at java.io.File.cre
Why are you calling createNewFile()? Just create the FileOutputStream.
createNewFile()