private static void deleteAndRename(FileSystem destFs, Path destFile, FileStatus srcStatus, Path destPath)
          throws IOException {
    try {
      // rename cannot overwrite non empty destination directory, so deleting the destination before renaming.
      destFs.delete(destFile);
      LOG.info("Deleted destination file: {}", destFile.toUri());
    } catch (FileNotFoundException e) {
      // no worries
    }
    if(!destFs.rename(srcStatus.getPath(), destFile)) {
      throw new IOException("rename for src path: " + srcStatus.getPath() + " to dest:"
              + destPath + " returned false");
    }
  }
Recycles the files recursively from the input path to the cmroot directory either by copying or moving it.

@param dataPath Path of the data files to be recycled to cmroot
@param isPurge
         When set to true files which needs to be recycled are not moved to Trash
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java