static String resolveVariables ( String string ) { if ( string == null ) { return null ; } String rval = string ; Matcher m = STRING_SUBSTITUTION . matcher ( string ) ; while ( m . find ( ) ) { if ( getInstance ( ) . properties . containsKey ( m . group ( 1 ) ) ) { rval = rval . replaceAll ( Pattern . quote ( m . group ( 0 ) ) , get ( m . group ( 1 ) ) . asString ( ) ) ; } else if ( System . getProperties ( ) . contains ( m . group ( 1 ) ) ) { rval = rval . replaceAll ( Pattern . quote ( m . group ( 0 ) ) , System . getProperties ( ) . get ( m . group ( 1 ) ) . toString ( ) ) ; } else if ( System . getenv ( ) . containsKey ( m . group ( 1 ) ) ) { rval = rval . replaceAll ( Pattern . quote ( m . group ( 0 ) ) , System . getenv ( ) . get ( m . group ( 1 ) ) ) ; } } return rval ; }
Resolve variables string .