Define a constant instead of duplicating literal 69/64169/1
authorSooriyaa <soponraj@in.ibm.com>
Mon, 3 Sep 2018 07:01:14 +0000 (12:31 +0530)
committerSooriyaa <soponraj@in.ibm.com>
Mon, 3 Sep 2018 07:01:39 +0000 (12:31 +0530)
Define a constant instead of duplicating literal

Issue-ID: VFC-1089
Change-Id: Ibda1b6977979975045c122441e373d0d6ec58c1f
Signed-off-by: Sooriyaa <soponraj@in.ibm.com>
juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/gvnfm/jujuvnfmadapter/common/FileUtils.java

index 3a8bc5c..7a178ca 100644 (file)
@@ -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);