public static void syncModificationTimes(Configuration conf,Path src,Path dest,Optional<PathFilter> filter) throws IOException {
  Set<FileStatus> srcFileStatuses=getFileStatusesRecursive(conf,src,filter);
  Map<String,Long> srcFileModificationTimes=null;
  try {
    srcFileModificationTimes=getRelativePathToModificationTime(src,srcFileStatuses);
  }
 catch (  ArgumentException e) {
    throw new IOException("Invalid file statuses!",e);
  }
  FileSystem destFs=dest.getFileSystem(conf);
  for (  String file : srcFileModificationTimes.keySet()) {
    destFs.setTimes(new Path(dest,file),srcFileModificationTimes.get(file),-1);
  }
}

public static void syncModificationTimes ( Configuration conf , Path src , Path dest , Optional < PathFilter > filter ) throws IOException { Set < FileStatus > srcFileStatuses = getFileStatusesRecursive ( conf , src , filter ) ; Map < String , Long > srcFileModificationTimes = null ; try { srcFileModificationTimes = getRelativePathToModificationTime ( src , srcFileStatuses ) ; } catch ( ArgumentException e ) { throw new IOException ( "Invalid file statuses!" , e ) ; } FileSystem destFs = dest . getFileSystem ( conf ) ; for ( String file : srcFileModificationTimes . keySet ( ) ) { destFs . setTimes ( new Path ( dest , file ) , srcFileModificationTimes . get ( file ) , - 1 ) ; } }
set the file modification times for the files on the destination to be the same as the modification times for the file on the source .
