aboutsummaryrefslogtreecommitdiffstats
path: root/common-be
diff options
context:
space:
mode:
Diffstat (limited to 'common-be')
-rw-r--r--common-be/pom.xml5
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/config/NonManoConfigurationManager.java19
2 files changed, 14 insertions, 10 deletions
diff --git a/common-be/pom.xml b/common-be/pom.xml
index 248edb30f9..f45c25f37b 100644
--- a/common-be/pom.xml
+++ b/common-be/pom.xml
@@ -109,11 +109,6 @@
</exclusions>
</dependency>
<dependency>
- <groupId>org.onap.sdc.sdc-tosca</groupId>
- <artifactId>sdc-tosca</artifactId>
- <version>${sdc-tosca-parser.version}</version>
- </dependency>
- <dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoConfigurationManager.java b/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoConfigurationManager.java
index 12813f231d..640c95bf65 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoConfigurationManager.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoConfigurationManager.java
@@ -19,13 +19,12 @@
package org.openecomp.sdc.be.config;
-import org.apache.commons.io.IOUtils;
-import org.onap.sdc.tosca.parser.utils.YamlToObjectConverter;
-import org.openecomp.sdc.be.config.exception.LoadConfigurationException;
-
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
+import org.apache.commons.io.IOUtils;
+import org.openecomp.sdc.be.config.exception.LoadConfigurationException;
+import org.yaml.snakeyaml.Yaml;
/**
* Singleton that loads and stores the Non Mano configuration
@@ -52,7 +51,7 @@ public class NonManoConfigurationManager {
} catch (final IOException e) {
throw new LoadConfigurationException("Could not parse non-mano configuration file 'config/nonManoConfig.yaml' to string", e);
}
- nonManoConfiguration = new YamlToObjectConverter().convertFromString(data, NonManoConfiguration.class);
+ nonManoConfiguration = convertFromString(data, NonManoConfiguration.class);
}
public static NonManoConfigurationManager getInstance() {
@@ -66,4 +65,14 @@ public class NonManoConfigurationManager {
public NonManoConfiguration getNonManoConfiguration() {
return nonManoConfiguration;
}
+
+ private <T> T convertFromString(final String yamlContents, final Class<T> className) {
+ try {
+ return (new Yaml()).loadAs(yamlContents, className);
+ } catch (final Exception e) {
+ throw new
+ LoadConfigurationException(String.format("Failed to convert YAML %s to object.", yamlContents), e);
+ }
+ }
+
}