Linux isn't excepted from wacky issues.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1112 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: RunAnywhere.java,v 1.2 2003/05/03 00:06:23 mdb Exp $
|
// $Id: RunAnywhere.java,v 1.3 2003/05/03 00:12:42 ray Exp $
|
||||||
|
|
||||||
package com.samskivert.util;
|
package com.samskivert.util;
|
||||||
|
|
||||||
@@ -30,6 +30,15 @@ public class RunAnywhere
|
|||||||
return _isMacOS;
|
return _isMacOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if we're running in a JVM that identifies its
|
||||||
|
* operating system as Linux.
|
||||||
|
*/
|
||||||
|
public static final boolean isLinux ()
|
||||||
|
{
|
||||||
|
return _isLinux;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the timestamp associated with the supplied event except on
|
* Returns the timestamp associated with the supplied event except on
|
||||||
* the Macintosh where it returns {@link System#currentTimeMillis}
|
* the Macintosh where it returns {@link System#currentTimeMillis}
|
||||||
@@ -49,6 +58,10 @@ public class RunAnywhere
|
|||||||
* is first loaded. */
|
* is first loaded. */
|
||||||
protected static boolean _isMacOS;
|
protected static boolean _isMacOS;
|
||||||
|
|
||||||
|
/** Flag indicating that we're on Linux; initialized when this class
|
||||||
|
* is first loaded. */
|
||||||
|
protected static boolean _isLinux;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
try {
|
try {
|
||||||
String osname = System.getProperty("os.name");
|
String osname = System.getProperty("os.name");
|
||||||
@@ -56,6 +69,7 @@ public class RunAnywhere
|
|||||||
_isWindows = (osname.indexOf("Windows") != -1);
|
_isWindows = (osname.indexOf("Windows") != -1);
|
||||||
_isMacOS = (osname.indexOf("Mac OS") != -1 ||
|
_isMacOS = (osname.indexOf("Mac OS") != -1 ||
|
||||||
osname.indexOf("MacOS") != -1);
|
osname.indexOf("MacOS") != -1);
|
||||||
|
_isLinux = (osname.indexOf("Linux") != -1);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// dang, can't grab system properties; we'll just pretend
|
// dang, can't grab system properties; we'll just pretend
|
||||||
// we're not on any of these OSes
|
// we're not on any of these OSes
|
||||||
|
|||||||
Reference in New Issue
Block a user