Also see - http://www.javaprogrammingforums.com/java-code-snippets-tutorials/107-how-write-file-using-java.html
Type: Posts; User: JavaPF
Also see - http://www.javaprogrammingforums.com/java-code-snippets-tutorials/107-how-write-file-using-java.html
Take a look at this example. You will be able to adapt it to suit your needs.
String fullName = "C:\\JavaPF\\input.txt";
File file = new File(fullName);
if(file.exists()){...