public static String getSystemPropOrEnvVar ( String name , String defaultValue ) { // env String value = System . getenv ( name ) ; if ( ! StringUtil . isEmpty ( value ) ) return value ; // prop value = System . getProperty ( name ) ; if ( ! StringUtil . isEmpty ( value ) ) return value ; // env 2 name = convertSystemPropToEnvVar ( name ) ; value = System . getenv ( name ) ; if ( ! StringUtil . isEmpty ( value ) ) return value ; return defaultValue ; }
returns a system setting by either a Java property name or a System environment variable