List of usage examples for org.apache.commons.lang3 SystemUtils IS_OS_WINDOWS_XP
boolean IS_OS_WINDOWS_XP
To view the source code for org.apache.commons.lang3 SystemUtils IS_OS_WINDOWS_XP.
Click Source Link
Is true if this is Windows XP.
From source file:com.vilt.minium.prefs.WebConsolePreferences.java
public File getChromeBin() { if (chromeBin == null) { // Based on expected Chrome default locations: // https://code.google.com/p/selenium/wiki/ChromeDriver if (SystemUtils.IS_OS_WINDOWS_XP) { return oneOf( new File(System.getenv("HOMEPATH"), "Local Settings\\Application Data\\Google\\Chrome\\Application\\chrome.exe"), new File(System.getenv("PROGRAMFILES"), "Google\\Chrome\\Application\\chrome.exe")); } else if (SystemUtils.IS_OS_WINDOWS) { return oneOf( new File(format("C:\\Users\\%s\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe", System.getenv("USERNAME"))), new File(System.getenv("PROGRAMFILES"), "Google\\Chrome\\Application\\chrome.exe"), new File(System.getenv("ProgramFiles(x86)"), "Google\\Chrome\\Application\\chrome.exe")); } else if (SystemUtils.IS_OS_LINUX) { return new File("/usr/bin/google-chrome"); } else if (SystemUtils.IS_OS_MAC_OSX) { return new File("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"); }/* w w w . jav a2 s . com*/ } return chromeBin; }
From source file:cz.babi.desktop.remoteme.common.Controller.java
/** * Shut down computer//from w ww .ja v a2s . co m */ public void doShutdown() { if (Common.DEBUG) LOGGER.debug("[doShutdown]"); String shutdownCommand = null; if (SystemUtils.IS_OS_AIX) shutdownCommand = "shutdown -Fh now"; else if (SystemUtils.IS_OS_FREE_BSD || SystemUtils.IS_OS_LINUX || SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_MAC_OSX || SystemUtils.IS_OS_NET_BSD || SystemUtils.IS_OS_OPEN_BSD || SystemUtils.IS_OS_UNIX) shutdownCommand = "shutdown -h now"; else if (SystemUtils.IS_OS_HP_UX) shutdownCommand = "shutdown -hy 1"; else if (SystemUtils.IS_OS_IRIX) shutdownCommand = "shutdown -y -g 1"; else if (SystemUtils.IS_OS_SOLARIS || SystemUtils.IS_OS_SUN_OS) shutdownCommand = "shutdown -y -i5 -g0"; else if (SystemUtils.IS_OS_WINDOWS_XP || SystemUtils.IS_OS_WINDOWS_VISTA || SystemUtils.IS_OS_WINDOWS_7 || System.getProperty("os.name").startsWith("win")) shutdownCommand = "shutdown.exe -s -t 0"; else { if (Common.DEBUG) LOGGER.debug("[doShutdown][Unknown OS.]"); return; } try { Runtime.getRuntime().exec(shutdownCommand); } catch (IOException e) { if (Common.ERROR) LOGGER.error("[doShutdown][Ups. Can not shut down pc.]"); } }
From source file:cz.babi.desktop.remoteme.common.Controller.java
/** * Restart computer.//from w w w . j av a2 s . co m */ public void doRestart() { if (Common.DEBUG) LOGGER.debug("[doRestart]"); String shutdownCommand = null; if (SystemUtils.IS_OS_FREE_BSD || SystemUtils.IS_OS_LINUX || SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_MAC_OSX || SystemUtils.IS_OS_NET_BSD || SystemUtils.IS_OS_OPEN_BSD || SystemUtils.IS_OS_UNIX) shutdownCommand = "shutdown -r now"; else if (SystemUtils.IS_OS_WINDOWS_XP || SystemUtils.IS_OS_WINDOWS_VISTA || SystemUtils.IS_OS_WINDOWS_7 || System.getProperty("os.name").startsWith("win")) shutdownCommand = "shutdown.exe -r -t 0"; else { if (Common.DEBUG) LOGGER.debug("[doRestart][Unknown OS.]"); return; } try { Runtime.getRuntime().exec(shutdownCommand); } catch (IOException e) { if (Common.ERROR) LOGGER.error("[doRestart][Ups. Can not restart pc.]"); } }
From source file:cz.babi.desktop.remoteme.common.Controller.java
/** * Log off current user.// w w w . j a v a 2 s . c o m */ public void doLogoff() { if (Common.DEBUG) LOGGER.debug("[doLogoff]"); String shutdownCommand = null; if (SystemUtils.IS_OS_WINDOWS_XP || SystemUtils.IS_OS_WINDOWS_VISTA || SystemUtils.IS_OS_WINDOWS_7 || System.getProperty("os.name").startsWith("win")) shutdownCommand = "shutdown.exe -l"; else { if (Common.DEBUG) LOGGER.debug("[doLogoff][Unknown OS.]"); return; } try { Runtime.getRuntime().exec(shutdownCommand); } catch (IOException e) { if (Common.ERROR) LOGGER.error("[doLogoff][Ups. Can not log off user.]"); } }