Example usage for org.apache.commons.lang3 SystemUtils IS_OS_MAC_OSX

List of usage examples for org.apache.commons.lang3 SystemUtils IS_OS_MAC_OSX

Introduction

In this page you can find the example usage for org.apache.commons.lang3 SystemUtils IS_OS_MAC_OSX.

Prototype

boolean IS_OS_MAC_OSX

To view the source code for org.apache.commons.lang3 SystemUtils IS_OS_MAC_OSX.

Click Source Link

Document

Is true if this is Mac.

Usage

From source file:gr.aueb.dmst.istlab.unixtools.util.EclipsePluginUtil.java

public static List<String> getSystemShellInfo() {
    List<String> shellInfo = new ArrayList<>();

    if (SystemUtils.IS_OS_LINUX) {
        shellInfo.add("/bin/bash");
        shellInfo.add("-c");
    } else if (SystemUtils.IS_OS_FREE_BSD) {
        shellInfo.add("");
        shellInfo.add("");
    } else if (SystemUtils.IS_OS_WINDOWS) {
        String value = Activator.getDefault().getPreferenceStore().getString(PropertiesLoader.SHELL_PATH_KEY);
        String cygwin = path(value) ? value + "bash.exe" : value + "/bash.exe";
        shellInfo.add("CMD");
        shellInfo.add("/C");
        shellInfo.add(cygwin.replace("\\", "/") + " --login -c ");
    } else if (SystemUtils.IS_OS_MAC_OSX) {
        shellInfo.add("/bin/sh");
        shellInfo.add("-c");
    }//from   w w  w.j av  a2s  .  co  m

    return shellInfo;
}

From source file:net.chris54721.infinitycubed.utils.Utils.java

public static File getAppdataPath() {
    if (SystemUtils.IS_OS_WINDOWS)
        return new File(System.getenv("APPDATA"));
    if (SystemUtils.IS_OS_MAC_OSX)
        return new File(System.getProperty("user.home") + "/Library/Application Support");
    if (SystemUtils.IS_OS_LINUX)
        return new File(System.getProperty("user.home"));
    return new File(System.getProperty("user.home"));
}

From source file:alluxio.util.OSUtils.java

/**
 * @return true if current OS is MacOS
 */
public static boolean isMacOS() {
    return SystemUtils.IS_OS_MAC_OSX;
}

From source file:com.o2d.pkayjava.editor.utils.Overlap2DUtils.java

private static String getMyDocumentsLocation() {
    String myDocuments = null;/* w w  w .j  a v  a 2 s  .  c  o  m*/
    try {
        if (SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_MAC_OSX) {
            myDocuments = System.getProperty("user.home") + File.separator + "Documents";
        }
        if (SystemUtils.IS_OS_WINDOWS) {
            Process p = Runtime.getRuntime().exec(
                    "reg query \"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\" /v personal");
            p.waitFor();

            InputStream in = p.getInputStream();
            byte[] b = new byte[in.available()];
            in.read(b);
            in.close();

            myDocuments = new String(b);
            myDocuments = myDocuments.split("\\s\\s+")[4];
        }
        if (SystemUtils.IS_OS_LINUX) {
            myDocuments = System.getProperty("user.home") + File.separator + "Documents";
        }

    } catch (Throwable t) {
        t.printStackTrace();
    }

    return myDocuments;
}

From source file:net.chris54721.infinitycubed.data.Library.java

public static URL getLibraryUrl(String name, String baseUrl, boolean hasNatives) {
    try {//  w ww  .  j av a 2s. co  m
        String[] sName = name.split(":");
        String path = sName[0].replaceAll("\\.", "/");
        String fileName = sName[1];
        String version = sName[2];
        String nativesString = "";
        if (hasNatives) {
            if (SystemUtils.IS_OS_WINDOWS)
                nativesString = "-natives-windows";
            if (SystemUtils.IS_OS_MAC_OSX)
                nativesString = "-natives-osx";
            if (SystemUtils.IS_OS_LINUX)
                nativesString = "-natives-linux";
        }
        return new URL(baseUrl + path + "/" + fileName + "/" + version + "/" + fileName + "-" + version
                + nativesString + ".jar");
    } catch (Exception e) {
        LogHelper.error("Failed getting library URL", e);
        return null;
    }
}

From source file:jd.ide.intellij.JavaDecompiler.java

/**
 * Library filename, depending on the OS identifier.
 *
 * @return lib filename./*  ww w .j  av  a 2 s. c om*/
 */
private static String libFileName() {
    if (SystemUtils.IS_OS_MAC_OSX) {
        return "libjd-intellij.jnilib";
    } else if (SystemUtils.IS_OS_WINDOWS) {
        return "jd-intellij.dll";
    } else if (SystemUtils.IS_OS_LINUX) {
        return "libjd-intellij.so";
    }
    throw new IllegalStateException("OS not supported");
}

From source file:com.o2d.pkayjava.editor.splash.SplashStarter.java

public SplashStarter(SplashScreen.SplashListener listener) {

    if (SystemUtils.IS_OS_MAC_OSX || SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_UNIX) {
        // let's work out osx splash screen later, not sure if we can have translucency there.
        listener.loadingComplete();/*from w  ww .ja v  a2s .  c om*/
        return;
    }

    splashScreen = new SplashScreen();
    LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
    config.fullscreen = false;
    config.width = 467;
    config.height = 415;
    config.resizable = false;
    splashFrame = new SplashFrame(splashScreen, config);
    /*
    GraphicsEnvironment ge =
        GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gd = ge.getDefaultScreenDevice();
    boolean isUniformTranslucencySupported = gd.isWindowTranslucencySupported(TRANSLUCENT);
    boolean isPerPixelTranslucencySupported = gd.isWindowTranslucencySupported(PERPIXEL_TRANSLUCENT);
    boolean isShapedWindowSupported = gd.isWindowTranslucencySupported(PERPIXEL_TRANSPARENT);
    */

    splashScreen.listener = listener;
}

From source file:com.blackducksoftware.integration.hub.jenkins.remote.GetIsOsMac.java

@Override
public Boolean call() throws IOException {
    return SystemUtils.IS_OS_MAC_OSX;
}

From source file:net.chris54721.infinitycubed.data.Library.java

public static File getLibraryFile(String name, boolean hasNatives) {
    try {//from w  ww  .  j a  v a2 s.co m
        String[] sName = name.split(":");
        String path = sName[0].replaceAll("\\.", "/");
        String fileName = sName[1];
        String version = sName[2];
        String nativesString = "";
        if (hasNatives) {
            if (SystemUtils.IS_OS_WINDOWS)
                nativesString = "-natives-windows";
            if (SystemUtils.IS_OS_MAC_OSX)
                nativesString = "-natives-osx";
            if (SystemUtils.IS_OS_LINUX)
                nativesString = "-natives-linux";
        }
        return Resources.getFile(Resources.ResourceType.LIBRARY,
                fileName + "-" + version + nativesString + ".jar");
    } catch (Exception e) {
        LogHelper.error("Failed getting library file", e);
        return null;
    }
}

From source file:io.github.bonigarcia.wdm.test.MarionetteTest.java

@Before
public void setupTest() {
    DesiredCapabilities capabilities = DesiredCapabilities.firefox();
    capabilities.setCapability("marionette", true);
    // This capability set need for beta\dev\nightly(version 45+) firefox because this driver is target on it
    if (SystemUtils.IS_OS_LINUX) {
        capabilities.setCapability("binary", "/usr/bin/firefox");
    } else if (SystemUtils.IS_OS_WINDOWS) {
        capabilities.setCapability("binary", "C:\\Program Files\\Mozilla Firefox\\firefox.exe");
    } else if (SystemUtils.IS_OS_MAC_OSX) {
        capabilities.setCapability("binary", "/Applications/Firefox.app");
    }// w ww  . ja v  a  2s.  c om
    driver = new MarionetteDriver(capabilities);
}