From 2c7785c5f171e90696f58be841f52c193c16aba1 Mon Sep 17 00:00:00 2001 From: Sooriyaa Date: Mon, 3 Sep 2018 12:31:14 +0530 Subject: Define a constant instead of duplicating literal Define a constant instead of duplicating literal Issue-ID: VFC-1089 Change-Id: Ibda1b6977979975045c122441e373d0d6ec58c1f Signed-off-by: Sooriyaa --- .../onap/vfc/nfvo/vnfm/gvnfm/jujuvnfmadapter/common/FileUtils.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'juju/juju-vnfmadapter/Juju-vnfmadapterService') diff --git a/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/gvnfm/jujuvnfmadapter/common/FileUtils.java b/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/gvnfm/jujuvnfmadapter/common/FileUtils.java index 3a8bc5c..7a178ca 100644 --- a/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/gvnfm/jujuvnfmadapter/common/FileUtils.java +++ b/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/gvnfm/jujuvnfmadapter/common/FileUtils.java @@ -45,6 +45,7 @@ public class FileUtils { public static final String GBK = "GBK"; private static Logger log = LoggerFactory.getLogger(FileUtils.class); + private static final String OS_NAME = "os.name"; private FileUtils(){ @@ -342,7 +343,7 @@ public class FileUtils { * */ public static boolean isWindows() { - String os = System.getProperty("os.name").toLowerCase(); + String os = System.getProperty(OS_NAME).toLowerCase(); // windows return (os.indexOf("win") >= 0); @@ -394,7 +395,7 @@ public class FileUtils { * */ public static boolean isMac() { - String os = System.getProperty("os.name").toLowerCase(); + String os = System.getProperty(OS_NAME).toLowerCase(); // Mac return (os.indexOf("mac") >= 0); @@ -407,7 +408,7 @@ public class FileUtils { * */ public static boolean isUnix() { - String os = System.getProperty("os.name").toLowerCase(); + String os = System.getProperty(OS_NAME).toLowerCase(); // linux or unix return (os.indexOf("nix") >= 0 || os.indexOf("nux") >= 0); -- cgit 1.2.3-korg