From: Oleg Mitsura Date: Thu, 22 Aug 2019 21:17:52 +0000 (-0400) Subject: Add output filename param to compresToFilePart X-Git-Tag: 0.6.0~3^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=c720be06d1f8e63fa922506103c361f8b01c8ac4;p=ccsdk%2Fcds.git Add output filename param to compresToFilePart 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 Change-Id: I464c242bf5651958671a06e1acf4148c28e69147 --- diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/utils/BluePrintEnhancerUtils.kt b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/utils/BluePrintEnhancerUtils.kt index a0f8ca9c5..97b9a813a 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/utils/BluePrintEnhancerUtils.kt +++ b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/utils/BluePrintEnhancerUtils.kt @@ -107,8 +107,9 @@ class BluePrintEnhancerUtils { return filePartFile.deCompress(deCompressFileName) } - suspend fun compressToFilePart(enhanceDir: String, archiveDir: String): ResponseEntity { - val compressedFile = normalizedFile(archiveDir, "enhanced-cba.zip") + suspend fun compressToFilePart(enhanceDir: String, archiveDir: String, + outputFileName:String="enhanced-cba.zip"): ResponseEntity { + val compressedFile = normalizedFile(archiveDir, outputFileName) BluePrintArchiveUtils.compress(Paths.get(enhanceDir).toFile(), compressedFile) return prepareResourceEntity(compressedFile.name, compressedFile.readBytes()) }