Add output filename param to compresToFilePart 23/94223/1
authorOleg Mitsura <oleg.mitsura@amdocs.com>
Thu, 22 Aug 2019 21:17:52 +0000 (17:17 -0400)
committerOleg Mitsura <oleg.mitsura@amdocs.com>
Fri, 23 Aug 2019 14:08:17 +0000 (10:08 -0400)
Currently, just defaults to "enhanced-cba.zip"
as before; Should be part of the feature that
names enhanced files yyyy-mm-dd-BPname-BPver

Issue-Id: CCSDK-1652

Signed-off-by: Oleg Mitsura <oleg.mitsura@amdocs.com>
Change-Id: I464c242bf5651958671a06e1acf4148c28e69147

ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/utils/BluePrintEnhancerUtils.kt

index a0f8ca9..97b9a81 100644 (file)
@@ -107,8 +107,9 @@ class BluePrintEnhancerUtils {
             return filePartFile.deCompress(deCompressFileName)
         }
 
-        suspend fun compressToFilePart(enhanceDir: String, archiveDir: String): ResponseEntity<Resource> {
-            val compressedFile = normalizedFile(archiveDir, "enhanced-cba.zip")
+        suspend fun compressToFilePart(enhanceDir: String, archiveDir: String,
+                                       outputFileName:String="enhanced-cba.zip"): ResponseEntity<Resource> {
+            val compressedFile = normalizedFile(archiveDir, outputFileName)
             BluePrintArchiveUtils.compress(Paths.get(enhanceDir).toFile(), compressedFile)
             return prepareResourceEntity(compressedFile.name, compressedFile.readBytes())
         }