Renaming Files having BluePrint to have Blueprint
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / inbounds / designer-api / src / main / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / designer / api / utils / BlueprintEnhancerUtils.kt
 package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils
 
 import kotlinx.coroutines.reactive.awaitSingle
-import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException
+import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException
 import org.onap.ccsdk.cds.controllerblueprints.core.data.ArtifactType
 import org.onap.ccsdk.cds.controllerblueprints.core.data.DataType
 import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeType
 import org.onap.ccsdk.cds.controllerblueprints.core.data.RelationshipType
 import org.onap.ccsdk.cds.controllerblueprints.core.deCompress
 import org.onap.ccsdk.cds.controllerblueprints.core.deleteNBDir
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoService
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRepoService
 import org.onap.ccsdk.cds.controllerblueprints.core.logger
 import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile
 import org.onap.ccsdk.cds.controllerblueprints.core.normalizedPathName
 import org.onap.ccsdk.cds.controllerblueprints.core.reCreateNBDirs
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext
-import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintArchiveUtils
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext
+import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintArchiveUtils
 import org.springframework.core.io.ByteArrayResource
 import org.springframework.core.io.Resource
 import org.springframework.http.HttpHeaders
@@ -42,58 +42,58 @@ import org.springframework.http.codec.multipart.FilePart
 import java.io.File
 import java.nio.file.Paths
 
-class BluePrintEnhancerUtils {
+class BlueprintEnhancerUtils {
     companion object {
 
-        val log = logger(BluePrintEnhancerUtils)
+        val log = logger(BlueprintEnhancerUtils)
 
         fun populateDataTypes(
-            bluePrintContext: BluePrintContext,
-            bluePrintRepoService: BluePrintRepoService,
+            bluePrintContext: BlueprintContext,
+            bluePrintRepoService: BlueprintRepoService,
             dataTypeName: String
         ): DataType {
             val dataType = bluePrintContext.serviceTemplate.dataTypes?.get(dataTypeName)
                 ?: bluePrintRepoService.getDataType(dataTypeName)
-                ?: throw BluePrintException("couldn't get DataType($dataTypeName) from repo.")
+                ?: throw BlueprintException("couldn't get DataType($dataTypeName) from repo.")
             bluePrintContext.serviceTemplate.dataTypes?.put(dataTypeName, dataType)
             return dataType
         }
 
         fun populateRelationshipType(
-            bluePrintContext: BluePrintContext,
-            bluePrintRepoService: BluePrintRepoService,
+            bluePrintContext: BlueprintContext,
+            bluePrintRepoService: BlueprintRepoService,
             relationshipName: String
         ): RelationshipType {
 
             val relationshipType = bluePrintContext.serviceTemplate.relationshipTypes?.get(relationshipName)
                 ?: bluePrintRepoService.getRelationshipType(relationshipName)
-                ?: throw BluePrintException("couldn't get RelationshipType($relationshipName) from repo.")
+                ?: throw BlueprintException("couldn't get RelationshipType($relationshipName) from repo.")
             bluePrintContext.serviceTemplate.relationshipTypes?.put(relationshipName, relationshipType)
             return relationshipType
         }
 
         fun populateNodeType(
-            bluePrintContext: BluePrintContext,
-            bluePrintRepoService: BluePrintRepoService,
+            bluePrintContext: BlueprintContext,
+            bluePrintRepoService: BlueprintRepoService,
             nodeTypeName: String
         ): NodeType {
 
             val nodeType = bluePrintContext.serviceTemplate.nodeTypes?.get(nodeTypeName)
                 ?: bluePrintRepoService.getNodeType(nodeTypeName)
-                ?: throw BluePrintException("couldn't get NodeType($nodeTypeName) from repo.")
+                ?: throw BlueprintException("couldn't get NodeType($nodeTypeName) from repo.")
             bluePrintContext.serviceTemplate.nodeTypes?.put(nodeTypeName, nodeType)
             return nodeType
         }
 
         fun populateArtifactType(
-            bluePrintContext: BluePrintContext,
-            bluePrintRepoService: BluePrintRepoService,
+            bluePrintContext: BlueprintContext,
+            bluePrintRepoService: BlueprintRepoService,
             artifactTypeName: String
         ): ArtifactType {
 
             val artifactType = bluePrintContext.serviceTemplate.artifactTypes?.get(artifactTypeName)
                 ?: bluePrintRepoService.getArtifactType(artifactTypeName)
-                ?: throw BluePrintException("couldn't get ArtifactType($artifactTypeName) from repo.")
+                ?: throw BlueprintException("couldn't get ArtifactType($artifactTypeName) from repo.")
             bluePrintContext.serviceTemplate.artifactTypes?.put(artifactTypeName, artifactType)
             return artifactType
         }
@@ -154,7 +154,7 @@ class BluePrintEnhancerUtils {
             outputFileName: String = "enhanced-cba.zip"
         ): ByteArray {
             val compressedFile = normalizedFile(archiveDir, outputFileName)
-            BluePrintArchiveUtils.compress(Paths.get(enhanceDir).toFile(), compressedFile)
+            BlueprintArchiveUtils.compress(Paths.get(enhanceDir).toFile(), compressedFile)
             return compressedFile.readBytes()
         }
 
@@ -166,7 +166,7 @@ class BluePrintEnhancerUtils {
         ):
             ResponseEntity<Resource> {
                 val compressedFile = normalizedFile(archiveDir, outputFileName)
-                BluePrintArchiveUtils.compress(Paths.get(enhanceDir).toFile(), compressedFile)
+                BlueprintArchiveUtils.compress(Paths.get(enhanceDir).toFile(), compressedFile)
                 return prepareResourceEntity(compressedFile)
             }