protected Keytab readKeytabFile(File file) {
    Keytab keytab;

    if (file.exists() && file.canRead() && (file.length() > 0)) {
      try {
        keytab = Keytab.read(file);
      } catch (IOException e) {
        // There was an issue reading in the existing keytab file... quietly assume no data
        keytab = null;
      }
    } else {
      keytab = null;
    }

    return keytab;
  }
Reads a file containing keytab data into a new Keytab

@param file A File containing the path to the file from which to read keytab data
@return a Keytab or null if the file was not readable
ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandler.java