private void updatePropertiesWithConfiguration ( final Properties props , final String key ) { final FilterConfig filterConfig = Context . get ( ) . getFilterConfig ( ) ; // first, retrieve value from init-param for backward compatibility final String valuesAsString = filterConfig . getInitParameter ( key ) ; if ( valuesAsString != null ) { props . setProperty ( key , valuesAsString ) ; } else { // retrieve value from configProperties file final String value = getConfigProperties ( ) . getProperty ( key ) ; if ( value != null ) { props . setProperty ( key , value ) ; } } }
Add to properties a new key with value extracted either from filterConfig or from configurable properties file . This method helps to ensure backward compatibility of the filterConfig vs configProperties configuration .