public static boolean createFile(File targetFile){
  if (targetFile.exists()) {
    if (targetFile.isFile())     return true;
    targetFile.delete();
  }
  try {
    return targetFile.createNewFile();
  }
 catch (  IOException e) {
    return false;
  }
}

public static boolean createFile ( File targetFile ) { if ( targetFile . exists ( ) ) { if ( targetFile . isFile ( ) ) return true ; targetFile . delete ( ) ; } try { return targetFile . createNewFile ( ) ; } catch ( IOException e ) { return false ; } }
create a file , if the file exists is not created .
