}
protected void addRepository()
throws IOException, RoleProfileException
{
RepositoryConfiguration repository = (RepositoryConfiguration) getRepository();
// Normalize the path
File file = new File( repository.getDirectory() );
repository.setDirectory( file.getCanonicalPath() );
if ( !file.exists() )
{
file.mkdirs();
// TODO: error handling when this fails, or is not a directory!
}
configuration.addRepository( repository );
// TODO: double check these are configured on start up
roleProfileManager.getDynamicRole( "archiva-repository-manager", repository.getId() );
roleProfileManager.getDynamicRole( "archiva-repository-observer", repository.getId() );
}