Author: echatellier Date: 2012-02-09 16:28:43 +0100 (Thu, 09 Feb 2012) New Revision: 2793 Url: http://chorem.org/repositories/revision/jtimer/2793 Log: Use jna to choose sysinfo implementation Modified: trunk/src/main/java/org/chorem/jtimer/ui/system/SystemInfoFactory.java Modified: trunk/src/main/java/org/chorem/jtimer/ui/system/SystemInfoFactory.java =================================================================== --- trunk/src/main/java/org/chorem/jtimer/ui/system/SystemInfoFactory.java 2012-02-09 15:27:51 UTC (rev 2792) +++ trunk/src/main/java/org/chorem/jtimer/ui/system/SystemInfoFactory.java 2012-02-09 15:28:43 UTC (rev 2793) @@ -31,6 +31,8 @@ import org.chorem.jtimer.ui.system.unix.UnixSystemInfo; import org.chorem.jtimer.ui.system.win32.Win32SystemInfo; +import com.sun.jna.Platform; + /** * Build system info determined from system. * @@ -67,7 +69,7 @@ throws UnsupportedSystemInfoException { if (instance == null) { - String os = System.getProperty("os.name").toLowerCase(); + String os = System.getProperty("os.name"); // log it if (log.isInfoEnabled()) { @@ -75,11 +77,11 @@ } // try windows - if (os.contains("windows")) { + if (Platform.isWindows()) { instance = new Win32SystemInfo(); - } else if (os.contains("linux")) { + } else if (Platform.isLinux()) { instance = new UnixSystemInfo(); - } else if (os.contains("mac os")) { + } else if (Platform.isMac()) { instance = new MacOSSystemInfo(); } else { // system unknown
participants (1)
-
echatellier@users.chorem.org