throw new IllegalStateException( "Failed to serialize settings to memory", e );
}
String serializedSettings = writer.toString();
RegexBasedInterpolator interpolator = new RegexBasedInterpolator();
interpolator.addValueSource( new PropertiesBasedValueSource( request.getUserProperties() ) );
interpolator.addValueSource( new PropertiesBasedValueSource( request.getSystemProperties() ) );
try
{
interpolator.addValueSource( new EnvarBasedValueSource() );
}
catch ( IOException e )
{
problems.add( new DefaultSettingsProblem( "Failed to use environment variables for interpolation: "
+ e.getMessage(), SettingsProblem.Severity.WARNING, "", -1, -1, e ) );
}
try
{
serializedSettings = interpolator.interpolate( serializedSettings, "settings" );
}
catch ( InterpolationException e )
{
problems.add( new DefaultSettingsProblem( "Failed to interpolate settings: " + e.getMessage(),
SettingsProblem.Severity.ERROR, "", -1, -1, e ) );