There were two problems with the original code:
1. Your filename was not being created correctly and included a number of spaces. This (fortunately) caused the program to crash thus exposing an error that was fairly easy to correct.
2. Trying to create a filename that contains embedded spaces will not work if the string is in ASCII, which was the case here. In order to correct this possible problem in the future you can add the following to your code:
try {
String sfn = "F:\\"+Ad+".html";
byte[] bfn = sfn.getBytes("UTF16");
String FILENAME = new String(bfn, "UTF16");
FileWriter fw = new FileWriter(FILENAME);
}
catch (Exception ex) {
ex.printStackTrace();
}