aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarry Huang <huangxiangyu5@huawei.com>2017-09-18 17:20:26 +0800
committerHarry Huang <huangxiangyu5@huawei.com>2017-09-18 17:20:51 +0800
commitb0c5f865b35158e26583e2422e02dd4dead5f208 (patch)
tree43fdee2a59f1dcce152f0da4b9d3e89235770f0d
parent2d4330263781424ef5dff0c094e48a6351cc90ec (diff)
fix patch 7
major: L163 Change-Id: I857265b6729cf06115a55cdb9b58e3396dd15cb2 Signed-off-by: Harry Huang <huangxiangyu5@huawei.com> Issue-Id: VNFSDK-85
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/filemanage/http/ToolUtil.java16
1 files changed, 7 insertions, 9 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/filemanage/http/ToolUtil.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/filemanage/http/ToolUtil.java
index 1b45e75f..e81a8bb4 100644
--- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/filemanage/http/ToolUtil.java
+++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/filemanage/http/ToolUtil.java
@@ -155,18 +155,16 @@ public class ToolUtil {
* @return boolean
*/
public static boolean createDir(String destDirName) {
- File dir = new File(destDirName);
+ String useDestDirName = destDirName;
+ if (!useDestDirName.endsWith(File.separator)) {
+ useDestDirName += File.separator;
+ }
+ File dir = new File(useDestDirName);
if (dir.exists()) {
dir.delete();
}
- if (!destDirName.endsWith(File.separator)) {
- destDirName = destDirName + File.separator;
- }
- if (dir.mkdirs()) {
- return true;
- } else {
- return false;
- }
+
+ return dir.mkdirs();
}
public static String getHttpServerAbsolutePath() {