com.ca.commons.cbutil
Class CBSystemProperties

java.lang.Object
  |
  +--com.ca.commons.cbutil.CBSystemProperties

public class CBSystemProperties
extends java.lang.Object

Sun, in their fairly limited wisdom, decided to disable the ability to get system environment variables in java. (Apart from a couple that they kindly decided to let through that are fairly useless). Apparently it wasn't platform independent enough, and might have screwed up their revenue stream. Or something.

Anyway, this class contains a filthy hack to get the information anyway, come hell, Sun, or high water. basically it shells a 'set' command, and attempts to do this on both unix and windows.

This is needed by some JX plugins, that rely on user-set system environment variables to do stuff.


Constructor Summary
CBSystemProperties()
           
 
Method Summary
static boolean isWindows()
          A simple minded test to see if we are running on a windows machine.
static boolean loadSystemProperties()
          This method reads the system environment property list, and adds them directly to the System.getProperties() global property list.
static void main(java.lang.String[] argsv)
          Main method for stand alone testing.
static void setDebug(boolean status)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CBSystemProperties

public CBSystemProperties()
Method Detail

setDebug

public static void setDebug(boolean status)

isWindows

public static boolean isWindows()
A simple minded test to see if we are running on a windows machine.

Returns:
true if on windows, false if not.

loadSystemProperties

public static boolean loadSystemProperties()
This method reads the system environment property list, and adds them directly to the System.getProperties() global property list.

Returns:
whether the operation was successfull, or whether an error (usually an IOException) occurred.

main

public static void main(java.lang.String[] argsv)
Main method for stand alone testing.

Parameters:
argsv - - not used.