diff options
author | 2023-02-20 16:17:11 +0000 | |
---|---|---|
committer | 2023-02-20 16:17:34 +0000 | |
commit | e59d6068616ea32d9c8074ea11241def2de34588 (patch) | |
tree | f6b961ff2258674cbc7c994e6703d68111448379 /cps-rest/src/main/java/org/onap/cps/rest/utils/ZipFileSizeValidator.java | |
parent | 99223ca17f8e9e257d1ac470df8d3f7de72491be (diff) |
Fix sonar code smell
Issue-ID: CPS-475
Change-Id: I6c213090862b68ccf44fb95395c57c717f52a9b2
Signed-off-by: halil.cakal <halil.cakal@est.tech>
Diffstat (limited to 'cps-rest/src/main/java/org/onap/cps/rest/utils/ZipFileSizeValidator.java')
-rw-r--r-- | cps-rest/src/main/java/org/onap/cps/rest/utils/ZipFileSizeValidator.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cps-rest/src/main/java/org/onap/cps/rest/utils/ZipFileSizeValidator.java b/cps-rest/src/main/java/org/onap/cps/rest/utils/ZipFileSizeValidator.java index 2e303d1d4..e514b93af 100644 --- a/cps-rest/src/main/java/org/onap/cps/rest/utils/ZipFileSizeValidator.java +++ b/cps-rest/src/main/java/org/onap/cps/rest/utils/ZipFileSizeValidator.java @@ -29,7 +29,7 @@ import org.onap.cps.spi.exceptions.ModelValidationException; public class ZipFileSizeValidator { private static final int THRESHOLD_ENTRIES = 10000; - private static int THRESHOLD_SIZE = 100000000; + private static int thresholdSize = 100000000; private static final double THRESHOLD_RATIO = 40; private static final String INVALID_ZIP = "Invalid ZIP archive content."; @@ -71,10 +71,10 @@ public class ZipFileSizeValidator { * Validate the total Size and number of entries in the zip. */ public void validateSizeAndEntries() { - if (totalUncompressedSizeOfYangFilesInArchive > THRESHOLD_SIZE) { + if (totalUncompressedSizeOfYangFilesInArchive > thresholdSize) { throw new ModelValidationException(INVALID_ZIP, String.format("The total size of uncompressed yang files exceeds the CPS limit of %s bytes.", - THRESHOLD_SIZE)); + thresholdSize)); } if (totalYangFileEntriesInArchive > THRESHOLD_ENTRIES) { throw new ModelValidationException(INVALID_ZIP, |