Perhaps somewhat embarassing, but after some hours I still cannot create a file in Java...
File file = new File(dirName + \"/\" + fileName); try { // -->
Try creating the parent dirs first:
File file = new File(dirName + File.separator + fileName); try { file.getParentFile().mkdirs(); file.createNewFile(); System.out.println("file != null"); return file; } catch (Exception e) { System.out.println(e.getMessage()); return null; }