public static void transformConfigFile(InputStream sourceStream, String destPath) throws Exception {
try {
Yaml yaml = new Yaml();
final Object loadedObject = yaml.load(sourceStream);
if (loadedObject instanceof Map) {
<BUG>final Map<String, Object> result = (Map<String, Object>) loadedObject;

ByteArrayOutputStream nifiPropertiesOutputStream = new ByteArrayOutputStream();
writeNiFiProperties(result, nifiPropertiesOutputStream);

DOMSource flowXml = createFlowXml(result);
</BUG>
writeNiFiPropertiesFile(nifiPropertiesOutputStream, destPath);

public static void transformConfigFile(InputStream sourceStream, String destPath) throws Exception {
try {
Yaml yaml = new Yaml();
final Object loadedObject = yaml.load(sourceStream);
if (loadedObject instanceof Map) {
final Map<String, Object> loadedMap = (Map<String, Object>) loadedObject;
ConfigSchema configSchema = new ConfigSchema(loadedMap);
if (!configSchema.isValid()) {
throw new InvalidConfigurationException("Failed to transform config file due to:" + configSchema.getValidationIssuesAsString());
}
ByteArrayOutputStream nifiPropertiesOutputStream = new ByteArrayOutputStream();
writeNiFiProperties(configSchema, nifiPropertiesOutputStream);
DOMSource flowXml = createFlowXml(configSchema);
writeNiFiPropertiesFile(nifiPropertiesOutputStream, destPath);
