throw ProvisioningException.makeExceptionFromErrorCode(CompMgtMessages.INVALID_REPO_NAME,
(nickName == null) ? "null value" : nickName);
}
try {
IMetadataRepositoryManager metadataRepositoryManager = ServiceHolder.getMetadataRepositoryManager();
IArtifactRepositoryManager artifactRepositoryManager = ServiceHolder.getArtifactRepositoryManager();
if (metadataRepositoryManager.contains(location)) {
return;
}
//Validating the repositories
status = metadataRepositoryManager.validateRepositoryLocation(location, null);
if (!status.isOK()) {
throw ProvisioningException.makeExceptionFromErrorCode(
CompMgtMessages.INVALID_REPO_LOCATION, location);
}
//Loading the metadata repository
metadataRepositoryManager.loadRepository(location, null);
metadataRepositoryManager.setRepositoryProperty(location, IRepository.PROP_NICKNAME, nickName);
//Loading the artifact repository
artifactRepositoryManager.loadRepository(location, null);
artifactRepositoryManager.setRepositoryProperty(location, IRepository.PROP_NICKNAME, nickName);
} catch (Exception e) {