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

public static boolean createNewFile ( File targetFile ) { if ( targetFile . exists ( ) ) targetFile . delete ( ) ; try { return targetFile . createNewFile ( ) ; } catch ( IOException e ) { return false ; } }
create a new file , if the file exists , delete and create again .
