Correct calculation of zip archive size for schemaset upload 87/133187/3
authorArne Chrestin <arne.chrestin@telekom.de>
Tue, 7 Feb 2023 16:39:24 +0000 (17:39 +0100)
committerArne Chrestin <arne.chrestin@telekom.de>
Wed, 8 Feb 2023 08:20:13 +0000 (09:20 +0100)
Correct calculation of zip archive size for schemaset upload

Issue-ID: CPS-1477
Change-Id: I73f97f986a817d423f93a8d922dcd9647b0203ab
Signed-off-by: Arne Chrestin <arne.chrestin@telekom.de>
cps-rest/src/main/java/org/onap/cps/rest/utils/MultipartFileUtil.java

index d5c2b09..534077c 100644 (file)
@@ -136,7 +136,7 @@ public class MultipartFileUtil {
             while ((numberOfBytesRead = zipInputStream.read(buffer, 0, READ_BUFFER_SIZE)) > 0) {
                 byteArrayOutputStream.write(buffer, 0, numberOfBytesRead);
                 totalSizeEntry += numberOfBytesRead;
-                zipFileSizeValidator.updateTotalSizeArchive(totalSizeEntry);
+                zipFileSizeValidator.updateTotalSizeArchive(numberOfBytesRead);
                 zipFileSizeValidator.validateCompresssionRatio(totalSizeEntry);
             }
             return byteArrayOutputStream.toString(StandardCharsets.UTF_8);