{
//
PropertyKeyToValueMap propertyKeyToValueMap = filenameToPropertyKeyToValueMap.get( fileName );
//
PropertyFile propertyFile = new PropertyFile( fileName );
if ( fileEncoding != null )
{
propertyFile.setFileEncoding( fileEncoding );
}
propertyFile.setUseJavaStyleUnicodeEscaping( useJavaStyleUnicodeEscaping );
propertyFile.load();
PropertyMap propertyMap = propertyFile.getPropertyFileContent().getPropertyMap();
//
boolean contentChanged = false;
for ( String propertyKey : propertyKeyToValueMap.keySet() )
{
//
String value = propertyKeyToValueMap.get( propertyKey );
//
if ( StringUtils.isNotEmpty( value ) )
{
//
String[] values = value.split( Pattern.quote( FileGroupToPropertiesAdapter.MULTILINE_VALUES_SEPARATOR ) );
//
Property property = propertyMap.containsKey( propertyKey ) ? property = propertyMap.get( propertyKey )
: new Property();
//
property.setKey( propertyKey );
property.clearValues();
property.addAllValues( Arrays.asList( values ) );
//
propertyMap.put( property );
//
contentChanged = true;
}
else if ( propertyMap.containsKey( propertyKey ) && deletePropertiesWithBlankValue )
{
//
propertyMap.remove( propertyKey );
//
contentChanged = true;
}
}
//
if ( contentChanged )
{
propertyFile.store();
}
}
//
if ( !missingPropertyInformationList.isEmpty() )