|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Dictionary<K,V>
java.util.Hashtable<java.lang.Object,java.lang.Object>
java.util.Properties
org.ops4j.util.environment.Environment
public class Environment
Encapsulates operating system and shell specific access to environment variables.
| Field Summary | |
|---|---|
static java.lang.String |
OSNAME
os.name System property |
static java.lang.String |
USERNAME
user.name System property |
| Fields inherited from class java.util.Properties |
|---|
defaults |
| Constructor Summary | |
|---|---|
Environment()
Creates a snapshot of the current shell environment variables for a user. |
|
| Method Summary | |
|---|---|
static java.io.File |
getDataDirectory(java.lang.String applicationname)
Returns the Data directory of the application for the logged in user. |
static java.lang.String |
getEnvVariable(java.lang.String name)
Gets the value of a shell environment variable. |
static java.util.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 java.io.File |
getSystemDirectory(java.lang.String applicationname)
Returns the System directory of the application for the logged in user. |
static java.lang.String |
getUserShell()
Gets the user's shell executable. |
static boolean |
isMacOsX()
Checks to see if the operating system is a UNIX variant. |
static boolean |
isNetWare()
Checks to see if the operating system is NetWare. |
static boolean |
isOpenVMS()
Checks to see if the operating system is OpenVMS. |
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, loadFromXML, propertyNames, save, setProperty, store, storeToXML, storeToXML |
| 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 java.lang.String OSNAME
public static final java.lang.String USERNAME
| Constructor Detail |
|---|
public Environment()
throws EnvironmentException
EnvironmentException - if there is an error accessing the environment| Method Detail |
|---|
public static java.io.File getDataDirectory(java.lang.String applicationname)
applicationname - The name of the application.
public static java.io.File getSystemDirectory(java.lang.String applicationname)
throws EnvironmentException
applicationname - The name of the application.
EnvironmentException - if the current system in not Windows or Unix/Linux.
public static java.lang.String getEnvVariable(java.lang.String name)
throws EnvironmentException
name - the name of variable
EnvironmentException - if there is a problem accessing the environmentpublic static boolean isUnix()
public static boolean isMacOsX()
public static boolean isWindows()
public static boolean isNetWare()
public static boolean isOpenVMS()
public static java.util.Properties getEnvVariables()
throws EnvironmentException
EnvironmentException - if os is not recognized
public static java.lang.String getUserShell()
throws EnvironmentException
EnvironmentException - the there is a problem accessing shell
information
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||