public static Token<org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier> getJobTrackerDelegationToken(
    Configuration conf, String userName) throws Exception {
    // LOG.info("getJobTrackerDelegationToken("+conf+","+userName+")");
    JobClient jcl = new JobClient(new JobConf(conf, HCatOutputFormat.class));
    Token<org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier> t = jcl
      .getDelegationToken(new Text(userName));
    // LOG.info("got "+t);
    return t;

    // return null;
  }
Ensure that read or write permissions are not granted without also
granting execute permissions. Essentially, r-- , rw- and -w- are invalid,
r-x, -wx, rwx, ---, --x are valid

@param perms The FsAction to verify
@return true if the presence of read or write permission is accompanied
        by execute permissions
hcatalog/core/src/main/java/org/apache/hive/hcatalog/common/HCatUtil.java