|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.stanford.hci.r3.util.SystemUtils
public class SystemUtils
Environment Variables, OS specific tasks, etc.
This software is distributed under the BSD License.
| Field Summary | |
|---|---|
static java.lang.String |
LIBRARY_PATH_KEY
Where to look for DLLs. |
static java.lang.String |
LINE_SEPARATOR
System character(s) for separating lines. |
static java.lang.String |
PATH_SEPARATOR
Different for UNIX/WINDOWS/MAC |
| Constructor Summary | |
|---|---|
SystemUtils()
|
|
| Method Summary | |
|---|---|
static void |
addToLibraryPath(java.net.URL url)
This doesn't work. |
static double |
getFreeMemoryInMB()
|
static java.io.File |
getWorkingDirectory()
|
static boolean |
operatingSystemIsMacOSX()
http://developer.apple.com/technotes/tn2002/tn2110.html |
static boolean |
operatingSystemIsWindowsVariant()
|
static void |
setWorkingDirectory(java.io.File file)
Deprecated. |
static void |
tic()
Save the current time, for simple profiling. |
static void |
toc()
Prints out the difference between now and the last time we tic'ed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String LIBRARY_PATH_KEY
public static final java.lang.String LINE_SEPARATOR
public static final java.lang.String PATH_SEPARATOR
| Constructor Detail |
|---|
public SystemUtils()
| Method Detail |
|---|
public static void addToLibraryPath(java.net.URL url)
url - public static double getFreeMemoryInMB()
public static java.io.File getWorkingDirectory()
public static boolean operatingSystemIsMacOSX()
public static boolean operatingSystemIsWindowsVariant()
public static void setWorkingDirectory(java.io.File file)
SystemUtils.setWorkingDirectory(new File("data/Flickr/"));
// argh! Setting the Working Directory doesn't work for files in this manner.
// Quite Stupid, in fact.
System.out.println(new File("Twistr1.xml").exists()); // returns false
System.out.println(new File("Twistr1.xml").getAbsoluteFile().exists()); // returns true
This is a KNOWN Java bug: http://bugs.sun.com/bugdatabase/view_bug.do;:YfiG?bug_id=4117557
Phooey. That means you have to call getAbsoluteFile() at every point in which you read a file
stream. I will have to instrument SystemUtils & FileUtils to handle this.
file - public static void tic()
public static void toc()
|
Copyright 2006 Stanford University | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||