private static void replaceWithBackup(File from,File to){
  if (!from.canRead())   exit("Failed to read source file '" + from.getAbsolutePath() + "'.",null);
  println("Replacing file '" + to.getAbsolutePath() + "'.");
  try {
    U.copy(from,renameToBak(to),true);
  }
 catch (  IOException e) {
    exit("Failed to replace file '" + to.getAbsolutePath() + "'.",e);
  }
}

private static void replaceWithBackup ( File from , File to ) { if ( ! from . canRead ( ) ) exit ( "Failed to read source file '" + from . getAbsolutePath ( ) + "'." , null ) ; println ( "Replacing file '" + to . getAbsolutePath ( ) + "'." ) ; try { U . copy ( from , renameToBak ( to ) , true ) ; } catch ( IOException e ) { exit ( "Failed to replace file '" + to . getAbsolutePath ( ) + "'." , e ) ; } }
replaces target file with source file .
