|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Dictionary
java.util.Hashtable
java.util.Properties
org.apache.avalon.util.env.Env
Encapsulates operating system and shell specific access to environment variables. TODO cleanup exception handling which is now in an odd state (constructors) need to be added and or changed.
Field Summary | |
static String |
OSNAME
os.name System property |
static String |
USERNAME
user.name System property |
Fields inherited from class java.util.Properties |
defaults |
Constructor Summary | |
Env()
Creates a snapshot of the current shell environment variables for a user. |
Method Summary | |
static String |
getEnvVariable(String a_name)
Gets the value of a shell environment variable. |
static Properties |
getEnvVariables()
Gets all environment variables within a Properties instance where the key is the environment variable name and value is the value of the property. |
static String |
getUserShell()
Gets the user's shell executable. |
static boolean |
isUnix()
Checks to see if the operating system is a UNIX variant. |
static boolean |
isWindows()
Checks to see if the operating system is a Windows variant. |
Methods inherited from class java.util.Properties |
getProperty, getProperty, list, list, load, propertyNames, save, setProperty, store |
Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String OSNAME
public static final String USERNAME
Constructor Detail |
public Env() throws EnvAccessException
EnvAccessException
- if there is an error accessing the environmentMethod Detail |
public static String getEnvVariable(String a_name) throws EnvAccessException
a_name
- the name of variable
Exception
- if there is a problem accessing the environment
EnvAccessException
public static boolean isUnix()
public static boolean isWindows()
public static Properties getEnvVariables() throws EnvAccessException
EnvAccessException
public static String getUserShell() throws EnvAccessException
EnvAccessException
- the there is a problem accessing shell
information
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |