code: static void copy(final Configuration conf, final Arguments args
        ) throws IOException {
      DistCopier copier = getCopier(conf, args);
      
      if (copier != null) {
        try {
          JobClient client = copier.getJobClient();
          RunningJob job = client.submitJob(copier.getJobConf());
          try {
            if (!client.monitorAndPrintJob(copier.getJobConf(), job)) {
              throw new IOException("Job failed!");
            }
          } catch (InterruptedException ie) {
            Thread.currentThread().interrupt();
          }
          copier.finalizeCopiedFiles();
        } finally {
          copier.cleanupJob();
        }
      }
    }
docs: Driver to copy srcPath to destPath depending on required protocol.
  @param args arguments