File f = new File("dir\\name.txt");
boolean created = f.createNewFile();
if (created)
// file creato
else
// ha avuto un problema