in spring-registry/spring-registry-commons/src/main/java/org/apache/archiva/redback/components/registry/commons/CommonsConfigurationRegistry.java [369:404]
public void addConfigurationFromFile( File file, String prefix )
throws RegistryException
{
CombinedConfiguration configuration = (CombinedConfiguration) this.configuration;
if ( file.getName().endsWith( ".properties" ) )
{
try
{
logger.debug( "Loading properties configuration from file: {}", file );
configuration.addConfiguration( new PropertiesConfiguration( file ), null, prefix );
}
catch ( ConfigurationException e )
{
throw new RegistryException(
"Unable to add configuration from file '" + file.getName() + "': " + e.getMessage(), e );
}
}
else if ( file.getName().endsWith( ".xml" ) )
{
try
{
logger.debug( "Loading XML configuration from file: {}", file );
configuration.addConfiguration( new XMLConfiguration( file ), null, prefix );
}
catch ( ConfigurationException e )
{
throw new RegistryException(
"Unable to add configuration from file '" + file.getName() + "': " + e.getMessage(), e );
}
}
else
{
throw new RegistryException(
"Unable to add configuration from file '" + file.getName() + "': unrecognised type" );
}
}