}
public void save( Configuration configuration )
throws RegistryException, IndeterminateConfigurationException
{
Registry section = registry.getSection( KEY + ".user" );
if ( section == null )
{
section = registry.getSection( KEY + ".base" );
if ( section == null )
{
section = createDefaultConfigurationFile();
}
}
else if ( registry.getSection( KEY + ".base" ) != null )
{
this.configuration = null;
throw new IndeterminateConfigurationException(
"Configuration can not be saved when it is loaded from two sources" );
}
new ConfigurationRegistryWriter().write( configuration, section );
section.save();
this.configuration = configuration;
}