Servertec
Foundation Classes
1.3.3 09/04/2005

stec.sfc.Win32
Class Env

java.lang.Object
  extended by stec.sfc.Win32.Env

public final class Env
extends java.lang.Object

Used to retrieve, set and remove environment variables.

Since:
1.0.0 01/07/2001

Constructor Summary
Env()
           
 
Method Summary
static java.lang.String[] getEnv()
          Returns all environment variables as an array of strings.
static java.lang.String getEnv(java.lang.String name)
          Returns the value associated with the specified environment variable.
static java.lang.String getEnv(java.lang.String name, java.lang.String default_value)
          Returns the value associated with the specified environment variable or the specified default if the specified environment variable does not exist.
static void putEnv(java.lang.String name, java.lang.String value)
          Used to create a new environment variable or modify or remove an existing one.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Env

public Env()
Method Detail

getEnv

public static final java.lang.String[] getEnv()
Returns all environment variables as an array of strings.

Returns:
an array of Strings containing all environment variables.

getEnv

public static final java.lang.String getEnv(java.lang.String name)
Returns the value associated with the specified environment variable.

Parameters:
name - the name of the environment variable.
Returns:
the value associated with the specified environment variable.

putEnv

public static final void putEnv(java.lang.String name,
                                java.lang.String value)
                         throws Win32Exception
Used to create a new environment variable or modify or remove an existing one.

Parameters:
name - the name of the environment variable.
value - the value to use. If empty String is used then the specified environment variable will be removed.
Throws:
Win32Exception - if any error occurs.

getEnv

public static final java.lang.String getEnv(java.lang.String name,
                                            java.lang.String default_value)
Returns the value associated with the specified environment variable or the specified default if the specified environment variable does not exist.

Parameters:
name - the name of the environment variable.
default_value - the default value to use if the specified environment variable does not exist.
Returns:
the value associated with the specified environment variable or the specified default value.

Servertec
Foundation Classes
1.3.3 09/04/2005

Copyright © 2001-2005 Servertec. All rights reserved.