diff options
Diffstat (limited to 'vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/common/FileUtil.java')
-rw-r--r-- | vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/common/FileUtil.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/common/FileUtil.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/common/FileUtil.java index 5697ddf7..777080f1 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/common/FileUtil.java +++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/common/FileUtil.java @@ -57,11 +57,7 @@ public final class FileUtil { */ public static boolean createDirectory(String dir) { File folder = new File(dir); - if (!folder.exists() && !folder.mkdirs()) { - return false; - } else { - return true; - } + return folder.exists() || folder.mkdirs(); } /** @@ -156,7 +152,7 @@ public final class FileUtil { gson.toJson(obj, writer); bResult = true; } catch (Exception e) { //NOSONAR - logger.info("Exception: writeJsonDatatoFile-->" + fileAbsPath, e); + logger.info("Exception: writeJsonDatatoFile-->{} {}" , fileAbsPath, e); } return bResult; } @@ -180,7 +176,7 @@ public final class FileUtil { try(JsonReader jsonReader = new JsonReader(new FileReader(fileAbsPath))) { obj = gson.fromJson(jsonReader, clazz); } catch (Exception e1) { //NOSONAR - logger.info("IOException Exception: writeJsonDatatoFile-->" + fileAbsPath, e1); + logger.info("IOException Exception: writeJsonDatatoFile-->{} {}" , fileAbsPath, e1); } return obj; } |