public List<LocalResource> localizeTempFilesFromConf(
      String hdfsDirPathStr, Configuration conf) throws IOException, LoginException {
    List<LocalResource> tmpResources = new ArrayList<LocalResource>();

    if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_ADD_FILES_USE_HDFS_LOCATION)) {
      // reference HDFS based resource directly, to use distribute cache efficiently.
      addHdfsResource(conf, tmpResources, LocalResourceType.FILE, getHdfsTempFilesFromConf(conf));
      // local resources are session based.
      tmpResources.addAll(
          addTempResources(conf, hdfsDirPathStr, LocalResourceType.FILE,
              getLocalTempFilesFromConf(conf), null).values()
      );
    } else {
      // all resources including HDFS are session based.
      tmpResources.addAll(
          addTempResources(conf, hdfsDirPathStr, LocalResourceType.FILE,
              getTempFilesFromConf(conf), null).values()
      );
    }

    tmpResources.addAll(
        addTempResources(conf, hdfsDirPathStr, LocalResourceType.ARCHIVE,
            getTempArchivesFromConf(conf), null).values()
    );
    return tmpResources;
  }
Localizes files, archives and jars the user has instructed us
to provide on the cluster as resources for execution.

@param conf
@return List&lt;LocalResource&gt; local resources to add to execution
@throws IOException when hdfs operation fails
@throws LoginException when getDefaultDestDir fails with the same exception
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java