Merge "Correct calculation of zip archive size for schemaset upload"
authorToine Siebelink <toine.siebelink@est.tech>
Wed, 8 Feb 2023 17:35:12 +0000 (17:35 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 8 Feb 2023 17:35:12 +0000 (17:35 +0000)
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);