All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.commons.util.OS Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev04
Show newest version
package org.infinispan.commons.util;

/**
 * Operating system family.
 *
 * Technically Solaris is UNIX, but for test purposes we are classifying it as a separate family.
 *
 * @since 9.2
 */
public enum OS {
   UNIX, WINDOWS, SOLARIS, LINUX, MAC_OS;

   public static OS getCurrentOs() {
      String os = System.getProperty("os.name").toLowerCase();
      if (os.contains("win")) {
         return WINDOWS;
      } else if (os.contains("sunos")) {
         return SOLARIS;
      } else if (os.contains("linux")) {
         return LINUX;
      } else if (os.toLowerCase().contains("mac os")) {
         return MAC_OS;
      } else {
         return UNIX;
      }
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy