@SuppressWarnings("deprecation")
  public static FileStatus validateTargetDir(Path path, Configuration conf) throws IOException {
    FileSystem fs = path.getFileSystem(conf);
    FileStatus fstatus = null;
    try {
      fstatus = fs.getFileStatus(path);
    } catch (FileNotFoundException fe) {
      // do nothing
    }
    return (fstatus != null && fstatus.isDir()) ? fstatus : null;
  }
Localizes files, archives and jars from a provided array of names.
@param hdfsDirPathStr Destination directory in HDFS.
@param conf Configuration.
@param inputOutputJars The file names to localize.
@return Map&lt;String, LocalResource&gt; (srcPath, local resources) to add to execution
@throws IOException when hdfs operation fails.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java