private void parseProperties() throws HdfsApiException {
    String defaultFS = getDefaultFS(context);

    try {

      if (isHAEnabled(defaultFS)) {
        copyHAProperties(defaultFS);

        LOG.info("HA HDFS cluster found.");
      } else {
        if (defaultFS.startsWith("webhdfs://") && !hasPort(defaultFS)) {
          defaultFS = addPortIfMissing(defaultFS);
        }
      }

      defaultFsUri = new URI(defaultFS);

    } catch (URISyntaxException e) {
      throw new HdfsApiException("HDFS060 Invalid " + DEFAULT_FS_INSTANCE_PROPERTY +
        "='" + defaultFS + "' URI", e);
    }

    conf.set("fs.defaultFS", defaultFS);
    LOG.info(String.format("HdfsApi configured to connect to defaultFS='%s'", defaultFS));

    //Exposing KMS configuration for Ambari Files View Instance with a "Local" cluster configuration
    if(context.getCluster() != null) {
      String encryptionKeyProviderUri = getEncryptionKeyProviderUri();
      if(encryptionKeyProviderUri != null) {
        conf.set("dfs.encryption.key.provider.uri", encryptionKeyProviderUri);
      }
    }
  }
takes context and any extra custom properties that needs to be included into config
@param context
@param customProperties
contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/ConfigurationBuilder.java