private String replaceVariables ( String initialContent , Map < String , String > variables ) { String newContent = initialContent ; // Only apply substitution if filtering is enabled and there is actually something to // substitute, otherwise just return the original content. if ( applyFiltering && newContent != null ) { newContent = newContent . replaceAll ( "\\{\\w*=.*}" , "" ) ; if ( variables != null ) { newContent = substituteVariables ( newContent , "\\$\\{(.+?)\\}" , variables ) ; } } return newContent ; }
Replace variables in the html file .