org.media.mn8.util
Class SystemEnvReader

java.lang.Object
  |
  +--org.media.mn8.util.SystemEnvReader

public class SystemEnvReader
extends java.lang.Object

Simple class which executes an system command meant to list all the system variables, parse the result of the command and returns the system variables and their values in an map.

Invocation:
SystemEnvReader.getSystemEnvironment()
In which case the "env" command is invoked. This is specific command for Unix environments.
or
SystemEnvReader.getSystemEnvironment(String cmd)
In which case the "cmd" command is invoked. This is the operating system specific command to list all the system variables. For Windows this "cmd" could be: "cmd.exe /c set".

Note: The parser expects that each variable is listed as it follows:
VAR_NAME=VAR_VALUE EOL

Version:
$Revision: 1.4 $ $Date: 2002/02/20 18:01:38 $
Author:
Remus Pereni

Constructor Summary
SystemEnvReader()
           
 
Method Summary
static java.util.Properties getSystemEnvironment()
          Returns the operating system specific environment variables and their values.
static java.util.Properties getSystemEnvironment(java.lang.String command)
          Returns the operating system specific environment variables and their values.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemEnvReader

public SystemEnvReader()
Method Detail

getSystemEnvironment

public static java.util.Properties getSystemEnvironment()
                                                 throws java.io.IOException
Returns the operating system specific environment variables and their values. This method automatically tries to invoke the "env" command which is particular for Unix operating systems!.
Returns:
A Properties containing the env variables name and value mappings.

getSystemEnvironment

public static java.util.Properties getSystemEnvironment(java.lang.String command)
                                                 throws java.io.IOException
Returns the operating system specific environment variables and their values. This method automatically tries to invoke the "cmd" command which is particular for the runtime operating system!
Parameters:
command - The "env" or "set" command particular to the operating system.
Returns:
A Properties containing the env variables name and value mappings.

main

public static void main(java.lang.String[] args)


"Copyright © 2001 Internet Multicasting Services & media.org. All Rights Reserved."