public static String getPassword(Configuration conf, String alias, String defPass)
    throws IOException {
    String passwd;
    char[] p = conf.getPassword(alias);
    if (p != null) {
      LOG.debug("Config option {} was found through the Configuration getPassword method.", alias);
      passwd = new String(p);
    } else {
      LOG.debug("Config option {} was not found. Using provided default value", alias);
      passwd = defPass;
    }
    return passwd;
  }
Get the password from the Configuration instance using the getPassword method if it exists. If
not, then fall back to the general get method for configuration elements.
@param conf    configuration instance for accessing the passwords
@param alias   the name of the password element
@param defPass the default password
@return String password or default password
hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java