logger.debug( "Loading properties configuration from classloader resource: {}", resource );
configuration.addConfiguration( new PropertiesConfiguration( resource ), null, prefix );
}
catch ( ConfigurationException e )
{
throw new RegistryException(
"Unable to add configuration from resource '" + resource + "': " + e.getMessage(), e );
}
}
else if ( resource.endsWith( ".xml" ) )
{
try
{
logger.debug( "Loading XML configuration from classloader resource: {}", resource );
configuration.addConfiguration( new XMLConfiguration( resource ), null, prefix );
}
catch ( ConfigurationException e )
{
throw new RegistryException(
"Unable to add configuration from resource '" + resource + "': " + e.getMessage(), e );
}
}
else
{
throw new RegistryException(
"Unable to add configuration from resource '" + resource + "': unrecognised type" );
}
}