// clean
  protected RepositoryResourceResponse getRepositoryResourceResponse(Request request, String repoId)
      throws ResourceException {
    RepositoryResourceResponse result = new RepositoryResourceResponse();

    try {
      RepositoryBaseResource resource = null;

      Repository repository = getRepositoryRegistry().getRepository(repoId);

      if (repository.getRepositoryKind().isFacetAvailable(GroupRepository.class)) {
        // it is a group, not a repo
        throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND, "Repository Not Found");
      }

      resource = getRepositoryRestModel(request, repository);

      result.setData(resource);
    } catch (NoSuchRepositoryAccessException e) {
      getLogger().warn("Repository access denied, id=" + repoId);

      throw new ResourceException(Status.CLIENT_ERROR_FORBIDDEN, "Access Denied to Repository");
    } catch (NoSuchRepositoryException e) {
      getLogger().warn("Repository not found, id=" + repoId);

      throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND, "Repository Not Found");
    }
    return result;
  }