diff options
author | 2018-08-30 14:17:06 +0000 | |
---|---|---|
committer | 2018-08-30 14:17:06 +0000 | |
commit | 905d8bf666e0667774bebccfabce65e3497e9c32 (patch) | |
tree | f9140a5b81ed876ead24759902ca7422eade2603 /ms/controllerblueprints/modules/core | |
parent | 254217ffff5edea9069f96b992a5939b3745d376 (diff) |
Controller Blueprints Microservice
Add Resource Seuencing validation and Optimise resource assignment validation logics
Change-Id: I6f31ca5dbeb6f6aa89959b7d96fbfad25468b3a4
Issue-ID: CCSDK-416
Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
Diffstat (limited to 'ms/controllerblueprints/modules/core')
-rw-r--r-- | ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt b/ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt index c41124ed3..9eef1cad5 100644 --- a/ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt +++ b/ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt @@ -59,6 +59,13 @@ object JacksonUtils { }
@JvmStatic
+ fun <T> readValueFromClassPathFile(fileName: String, valueType: Class<T>): T? {
+ val content: String = IOUtils.toString(JacksonUtils::class.java.classLoader.getResourceAsStream(fileName), Charset.defaultCharset())
+ ?: throw BluePrintException(String.format("Failed to read json file : %s", fileName))
+ return readValue(content, valueType)
+ }
+
+ @JvmStatic
fun jsonNodeFromObject(from: kotlin.Any): JsonNode = jacksonObjectMapper().convertValue(from, JsonNode::class.java)
@JvmStatic
|