code: public LocalResource uploadAsLocalResource(final File localFile, final LocalResourceType type) throws IOException {
      final Path remoteFile = upload(localFile);
      return getLocalResourceForPath(remoteFile, type);
    }
docs: Shortcut to first upload the file and then form a LocalResource for the YARN submission.
  @param localFile File on local FS to upload to the (remote) DFS.
  @return an instance of a LocalResource on (remote) DFS.
  @throws IOException if unable to upload the file or local file cannot be read.