}
else if ("group".equals(repoType)) {
templateSet = templateSet.getTemplates(GroupRepository.class);
}
NexusRepositoryTypeListResourceResponse result = new NexusRepositoryTypeListResourceResponse();
if (templateSet.getTemplatesList().isEmpty()) {
throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND);
}
for (Template template : templateSet.getTemplatesList()) {
NexusRepositoryTypeListResource resource = new NexusRepositoryTypeListResource();
String providerRole = ((RepositoryTemplate) template).getRepositoryProviderRole();
String providerHint = ((RepositoryTemplate) template).getRepositoryProviderHint();
resource.setProvider(providerHint);
resource.setProviderRole(providerRole);
resource.setFormat(((AbstractRepositoryTemplate) template).getContentClass().getId());
// To not disturb the "New repo UI", it's shitty right now: we select templates here that predefines is
// something a "release" or "snapshot", but
// UI allows to select that too.
resource.setDescription(removeBrackets(template.getDescription()));
// add it to the collection
result.addData(resource);
}
return result;
}