org.media.mn8.util
Class SystemEnvReader

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

public class SystemEnvReader
extends 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.5 $ $Date: 2002/09/16 23:07:04 $
Author:
Remus Pereni

Constructor Summary
SystemEnvReader()
           
 
Method Summary
static Properties getSystemEnvironment()
          Returns the operating system specific environment variables and their values.
static Properties getSystemEnvironment(String command)
          Returns the operating system specific environment variables and their values.
static void main(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 Properties getSystemEnvironment()
                                       throws 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.
IOException

getSystemEnvironment

public static Properties getSystemEnvironment(String command)
                                       throws 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.
IOException

main

public static void main(String[] args)


"Copyright © 2000-2002 Internet Multicasting Services, media.org & noLimits Technologies. All Rights Reserved."