Package org.pentaho.di.core.util
Class EnvUtil
java.lang.Object
org.pentaho.di.core.util.EnvUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Add a number of internal variables to the Kettle Variables at the root.static void
applyKettleProperties
(Map<?, ?> kettleProperties) static void
applyKettleProperties
(Map<?, ?> kettleProperties, boolean override) static final String
static Locale
createLocale
(String localeCode) Returns an available java.util.Locale object for the given localeCode.static TimeZone
createTimeZone
(String timeZoneId) static void
Adds the kettle properties the the global system properties.static final String[]
static String[]
static final String
getSystemProperty
(String key) static final String
getSystemProperty
(String key, String def) This method is written especially for weird JVM's likestatic final String
getSystemPropertyStripQuotes
(String key, String def) This method is written especially for weird JVM's like IBM's on AIX and OS/400.static String[]
static Properties
readProperties
(String fileName) Returns the properties from the users kettle home directory.
-
Constructor Details
-
EnvUtil
public EnvUtil()
-
-
Method Details
-
readProperties
Returns the properties from the users kettle home directory.- Parameters:
fileName
- the relative name of the properties file in the users kettle directory.- Returns:
- the map of properties.
- Throws:
KettleException
-
environmentInit
Adds the kettle properties the the global system properties.- Throws:
KettleException
- in case the properties file can't be read.
-
applyKettleProperties
-
applyKettleProperties
-
addInternalVariables
Add a number of internal variables to the Kettle Variables at the root.- Parameters:
prop
-
-
getEnvironmentVariablesForRuntimeExec
- Returns:
- an array of strings, made up of all the environment variables available in the VM, format var=value. To be used for Runtime.exec(cmd, envp)
-
getSystemPropertyStripQuotes
This method is written especially for weird JVM's like IBM's on AIX and OS/400. On these platforms, we notice that environment variables have an extra double quote around it... This is messing up the ability to specify things.- Parameters:
key
- The key, the name of the environment variable to returndef
- The default value to return in case the key can't be found- Returns:
- The value of a System environment variable in the java virtual machine. If the key is not present, the variable is not defined and the default value is returned.
-
getSystemProperty
This method is written especially for weird JVM's like- Parameters:
key
- The key, the name of the environment variable to returndef
- The default value to return in case the key can't be found- Returns:
- The value of a System environment variable in the java virtual machine. If the key is not present, the variable is not defined and the default value is returned.
-
getSystemProperty
- Parameters:
key
- The key, the name of the environment variable to return- Returns:
- The value of a System environment variable in the java virtual machine. If the key is not present, the variable is not defined and null returned.
-
clearSystemProperty
- Parameters:
key
- The key, the name of the environment variable to clear- Returns:
- The value of a System environment variable in the java virtual machine. If the key is not present, the variable is not defined and null returned.
-
createLocale
Returns an available java.util.Locale object for the given localeCode. The localeCode code can be case insensitive, if it is available the method will find it and return it.- Parameters:
localeCode
-- Returns:
- java.util.Locale.
-
createTimeZone
-
getTimeZones
-
getLocaleList
-