class CatalogRest {

    @GET
    @Path("{catalogId}/records/{recordId}/versions/{versionId}/distributions/{distributionId}")
    @Produces(MediaType.APPLICATION_JSON)
    @RolesAllowed("user")
    @ApiOperation("Gets a specific Distribution for the identified Version.")
    public Response getVersionedDistribution(@PathParam("catalogId") String catalogId,
                                      @PathParam("recordId") String recordId,
                                      @PathParam("versionId") String versionId,
                                      @PathParam("distributionId") String distributionId) {
        try {
            Distribution distribution = catalogManager.getVersionedDistribution(vf.createIRI(catalogId),
                    vf.createIRI(recordId), vf.createIRI(versionId), vf.createIRI(distributionId)).orElseThrow(() ->
                    ErrorUtils.sendError("Distribution " + distributionId + " could not be found",
                            Response.Status.NOT_FOUND));
            return Response.ok(thingToSkolemizedObjectNode(distribution, Distribution.TYPE, transformer, bNodeService)
                    .toString()).build();
        } catch (IllegalArgumentException ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.BAD_REQUEST);
        } catch (MobiException ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.INTERNAL_SERVER_ERROR);
        }
    }

}