public FileStatus getHiveJarDirectory(Configuration conf) throws IOException, LoginException {
    FileStatus fstatus = null;
    String hdfsDirPathStr = HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_JAR_DIRECTORY, (String)null);
    if (hdfsDirPathStr != null) {
      LOG.info("Hive jar directory is " + hdfsDirPathStr);
      fstatus = validateTargetDir(new Path(hdfsDirPathStr), conf);
    }

    if (fstatus == null) {
      Path destDir = getDefaultDestDir(conf);
      LOG.info("Jar dir is null / directory doesn't exist. Choosing HIVE_INSTALL_DIR - " + destDir);
      fstatus = validateTargetDir(destDir, conf);
    }

    if (fstatus == null) {
      throw new IOException(ErrorMsg.NO_VALID_LOCATIONS.getMsg());
    }
    return fstatus;
  }
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