private void writeFilesList(FileStatus[] fileStatuses, BufferedWriter writer, String encodedSubDirs)
          throws IOException, SemanticException {
    for (FileStatus fileStatus : fileStatuses) {
      if (fileStatus.isDirectory()) {
        // Write files inside the sub-directory.
        Path subDir = fileStatus.getPath();
        writeFilesList(listFilesInDir(subDir), writer, encodedSubDir(encodedSubDirs, subDir));
      } else {
        writer.write(encodedUri(fileStatus, encodedSubDirs));
        writer.newLine();
      }
    }
  }
This needs the root data directory to which the data needs to be exported to.
The data export here is a list of files either in table/partition that are written to the _files
in the exportRootDataDir provided.
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/io/FileOperations.java