private Collection<PropertyInfo> parseProperties(ConfigurationXml configuration, String fileName) {
  List<PropertyInfo> props = new ArrayList<>();
  for (PropertyInfo pi : configuration.getProperties()) {
    pi.setFilename(fileName);
    if(pi.getPropertyTypes().contains(PropertyInfo.PropertyType.VALUE_FROM_PROPERTY_FILE)) {
      if(propertiesDirFile != null && propertiesDirFile.exists() && propertiesDirFile.isDirectory() ) {
        String propertyFileName = pi.getPropertyValueAttributes().getPropertyFileName();
        String propertyFileType = pi.getPropertyValueAttributes().getPropertyFileType();
        String propertyFilePath = propertiesDirFile.getAbsolutePath() + File.separator + propertyFileName;
        File propertyFile = new File(propertyFilePath);
        if (propertyFile.exists() && propertyFile.isFile()) {
          try {
            String propertyValue =
                    FileUtils.readFileToString(propertyFile, Charset.defaultCharset());
            boolean valid = true;
            switch (propertyFileType.toLowerCase()) {
              case "xml" :
                if (!XmlUtils.isValidXml(propertyValue)) {
                  valid = false;
                  LOG.error("Failed to load value from property file. Property file {} is not a valid XML file", propertyFilePath);
                }
                break;
              case "json":
                if (!JsonUtils.isValidJson(propertyValue)) {
                  valid = false;
                  LOG.error("Failed to load value from property file. Property file {} is not a valid JSON file", propertyFilePath);
                }
                break;
              case "text":
                // fallthrough
              default:
                // no validity check
                break;
            }
            if (valid) {
              pi.setValue(propertyValue);
            }
          } catch (IOException e) {
            LOG.error("Failed to load value from property file {}. Error Message {}", propertyFilePath, e.getMessage());
          }
        } else {
          LOG.error("Failed to load value from property file. Properties file {} does not exist", propertyFilePath);
        }
      } else {
        if (propertiesDirFile == null) {
          LOG.error("Failed to load value from property file. Properties directory is null");
        } else {
          LOG.error("Failed to load value from property file. Properties directory {} does not exist", propertiesDirFile.getAbsolutePath());
        }
      }
    }
    props.add(pi);
  }
  return props; }
Parse a configurations properties.

@param configuration  object representation of a configuration file
@param fileName       configuration file name

@return  collection of properties
ambari-server/src/main/java/org/apache/ambari/server/stack/ConfigurationDirectory.java