From d1cdc63f13a680a1c7438461c56e86f3580cfeb9 Mon Sep 17 00:00:00 2001 From: "prakash.e@huawei.com" Date: Sun, 10 Apr 2022 20:28:12 +0530 Subject: vnfsdk validation code refactoring in method createDirectory https://sonarcloud.io/project/issues?resolved=false&severities=BLOCKER&types=VULNERABILITY&id=onap_vnfsdk-validation&open=AXk4ivruWcQzNZo7t49l Issue-ID: VNFSDK-832 Signed-off-by: prakash.e@huawei.com Change-Id: Ib123d5f3648d81c3583119996ec7e50699f6cfec --- csarvalidation/src/main/java/org/onap/validation/csar/FileUtil.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/csarvalidation/src/main/java/org/onap/validation/csar/FileUtil.java b/csarvalidation/src/main/java/org/onap/validation/csar/FileUtil.java index 45c8db1..07dece1 100644 --- a/csarvalidation/src/main/java/org/onap/validation/csar/FileUtil.java +++ b/csarvalidation/src/main/java/org/onap/validation/csar/FileUtil.java @@ -50,8 +50,12 @@ public final class FileUtil { int tryCount = 0; while (tryCount < TRY_COUNT) { tryCount++; - if (folder.exists() || folder.mkdirs()) { + if (folder.exists()) { return true; + } else { + if (folder.mkdirs()) { + return true; + } } } -- cgit 1.2.3-korg