private LocalResource createJarLocalResource(String localJarPath,
      DagUtils utils, Configuration conf) throws IOException, LoginException,
      IllegalArgumentException, FileNotFoundException {
    FileStatus destDirStatus = utils.getHiveJarDirectory(conf);
    assert destDirStatus != null;
    Path destDirPath = destDirStatus.getPath();

    Path localFile = new Path(localJarPath);
    if (sha == null || !destDirPath.toString().contains(sha)) {
      sha = getSha(localFile, conf);
    }

    String destFileName = localFile.getName();

    // Now, try to find the file based on SHA and name. Currently we require
    // exact name match.
    // We could also allow cutting off versions and other stuff provided that
    // SHA matches...
    destFileName = FilenameUtils.removeExtension(destFileName) + "-" + sha
        + FilenameUtils.EXTENSION_SEPARATOR
        + FilenameUtils.getExtension(destFileName);

    // TODO: if this method is ever called on more than one jar, getting the dir
    // and the
    // list need to be refactored out to be done only once.
    Path destFile = new Path(destDirPath.toString() + "/" + destFileName);
    return utils.localizeResource(localFile, destFile, LocalResourceType.FILE,
        conf);
  }
Returns a local resource representing a jar. This resource will be used to
execute the plan on the cluster.

@param localJarPath
         Local path to the jar to be localized.
@return LocalResource corresponding to the localized hive exec resource.
@throws IOException
          when any file system related call fails.
@throws LoginException
          when we are unable to determine the user.
@throws URISyntaxException
          when current jar location cannot be determined.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits.java