aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/main/java/org/onap
diff options
context:
space:
mode:
authorpriyanka.akhade <priyanka.akhade@huawei.com>2020-05-06 10:41:12 +0000
committerpriyanka.akhade <priyanka.akhade@huawei.com>2020-05-07 14:49:17 +0000
commit410f81f2be31540ac3f66e31726e0e6ed7fc4144 (patch)
tree0d0f8524909743d433fa911427169cf647f91837 /framework/src/main/java/org/onap
parent43daaf01499ac80d52187507e50f6ce7c5ce6026 (diff)
sonar vulnerability issue fix- Do something with the "boolean" value returned by "delete"; Enable server certificate validation on this SSL/TLS connection
Signed-off-by: priyanka.akhade <priyanka.akhade@huawei.com> Issue-ID: CLI-270 Change-Id: I1aa94f93bd71beeb0b6f6758be4b0687ea8536d2
Diffstat (limited to 'framework/src/main/java/org/onap')
-rw-r--r--framework/src/main/java/org/onap/cli/fw/store/OnapCommandArtifactStore.java4
-rw-r--r--framework/src/main/java/org/onap/cli/fw/store/OnapCommandExecutionStore.java4
-rw-r--r--framework/src/main/java/org/onap/cli/fw/store/OnapCommandProfileStore.java4
3 files changed, 9 insertions, 3 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/store/OnapCommandArtifactStore.java b/framework/src/main/java/org/onap/cli/fw/store/OnapCommandArtifactStore.java
index d43b51d8..7ffe05e1 100644
--- a/framework/src/main/java/org/onap/cli/fw/store/OnapCommandArtifactStore.java
+++ b/framework/src/main/java/org/onap/cli/fw/store/OnapCommandArtifactStore.java
@@ -255,7 +255,9 @@ public class OnapCommandArtifactStore {
if (!aFile.exists()) {
throw new OnapCommandArtifactNotFound(name, category);
}
- aFile.delete();
+ if(!aFile.delete()){
+ log.error("Failed to delete the artifact " + aFile.getAbsolutePath());
+ }
}
public Artifact updateArtifact(String name, String category, Artifact artifact) throws OnapCommandArtifactNotFound, OnapCommandArtifactContentNotExist, OnapCommandArtifactAlreadyExist {
diff --git a/framework/src/main/java/org/onap/cli/fw/store/OnapCommandExecutionStore.java b/framework/src/main/java/org/onap/cli/fw/store/OnapCommandExecutionStore.java
index d09dfa50..a22eb084 100644
--- a/framework/src/main/java/org/onap/cli/fw/store/OnapCommandExecutionStore.java
+++ b/framework/src/main/java/org/onap/cli/fw/store/OnapCommandExecutionStore.java
@@ -267,7 +267,9 @@ public class OnapCommandExecutionStore {
else
FileUtils.touch(new File(context.getStorePath() + File.separator + "failed"));
- new File(context.getStorePath() + File.separator + "in-progress").delete();
+ if(!new File(context.getStorePath() + File.separator + "in-progress").delete()){
+ log.error("Failed to delete "+ context.getStorePath() + File.separator + "in-progress");
+ }
} catch (IOException e) {
log.error("Failed to store the execution end details " + context.storePath);
}
diff --git a/framework/src/main/java/org/onap/cli/fw/store/OnapCommandProfileStore.java b/framework/src/main/java/org/onap/cli/fw/store/OnapCommandProfileStore.java
index 68d57c77..6455447e 100644
--- a/framework/src/main/java/org/onap/cli/fw/store/OnapCommandProfileStore.java
+++ b/framework/src/main/java/org/onap/cli/fw/store/OnapCommandProfileStore.java
@@ -206,7 +206,9 @@ public class OnapCommandProfileStore {
String dataDir = getDataStorePath();
File file = new File(dataDir + File.separator + profile + DATA_PATH_PROFILE_JSON);
if (file.exists()) {
- file.delete();
+ if(!file.delete()){
+ log.error("Failed to delete profile "+file.getAbsolutePath());
+ }
}
}