Perhaps somewhat embarassing, but after some hours I still cannot create a file in Java...
File file = new File(dirName + \"/\" + fileName);
try
{
// -->
String dirName="c:\\dir1\\dir2";
String fileName="fileName.txt";
File file = new File(dirName + "/" + fileName);
try {
new File(dirName).mkdirs(); // directory created here
file.createNewFile(); // file created here
System.out.println("file != null");
return file;
}catch(Exception e)
{
System.out.println(e.getMessage());
return null;
}