Just Giving an alternative way to create the file only if doesn't exists using Path and Files.
Path path = Paths.get("Some/path/filename.txt");
Files.createDirectories(path.getParent());
if( !Files.exists(path))
Files.createFile(path);
Files.write(path, ("").getBytes());