private void copyPropertiesBySite(String type) {
    if (context.getCluster() != null) {
      Map<String, String> configs = context.getCluster().getConfigByType(type);
      LOG.debug("configs from core-site : {}", configs);
      copyProperties(configs);
    } else {
      LOG.error("Cannot find cluster.");
    }
  }
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