From c720be06d1f8e63fa922506103c361f8b01c8ac4 Mon Sep 17 00:00:00 2001 From: Oleg Mitsura Date: Thu, 22 Aug 2019 17:17:52 -0400 Subject: 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 --- .../cds/controllerblueprints/service/utils/BluePrintEnhancerUtils.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ms/controllerblueprints/modules/service/src') 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()) } -- cgit 1.2.3-korg