private Map<String, LocalResource> addTempResources(Configuration conf, String hdfsDirPathStr,
      LocalResourceType type, String[] files, String[] skipFiles) throws IOException {
    HashSet<Path> skipFileSet = null;
    Map<String, LocalResource> tmpResourcesMap = new HashMap<>();
    if (skipFiles != null) {
      skipFileSet = new HashSet<>();
      for (String skipFile : skipFiles) {
        if (StringUtils.isBlank(skipFile)) {
          continue;
        }
        skipFileSet.add(new Path(skipFile));
      }
    }
    for (String file : files) {
      if (!StringUtils.isNotBlank(file)) {
        continue;
      }
      Path path = new Path(file);
      if (skipFileSet != null && skipFileSet.contains(path)) {
        LOG.info("Skipping vertex resource " + file + " that already exists in the session");
        continue;
      }
      path = FileUtils.resolveSymlinks(path, conf);
      Path hdfsFilePath = new Path(hdfsDirPathStr, getResourceBaseName(path));
      LocalResource localResource = localizeResource(path, hdfsFilePath, type, conf);
      tmpResourcesMap.put(file, localResource);
    }
    return tmpResourcesMap;
  }
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