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

play.utils.OS Maven / Gradle / Ivy

There is a newer version: 2.6.2
Show newest version
package play.utils;

/**
 * Os detections
 */
public class OS {

    public static boolean isWindows() {
        String os = System.getProperty("os.name").toLowerCase();
        return os != null && os.indexOf("win") >= 0;
    }

    public static boolean isMac() {
        String os = System.getProperty("os.name").toLowerCase();
        return os != null && (os.toLowerCase().indexOf("mac") >= 0);
    }

    public static boolean isUnix() {
        String os = System.getProperty("os.name").toLowerCase();
        return os != null && (os.indexOf("nix") >= 0 || os.indexOf("nux") >= 0 || os.indexOf("aix") > 0);
    }

    public static boolean isSolaris() {
        String os = System.getProperty("os.name").toLowerCase();
        return (os != null && os.indexOf("sunos") >= 0);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy