Source:
public Response getContentAccessBody( @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid, @HeaderParam("If-Modified-Since") @DefaultValue("Thu, 01 Jan 1970 00:00:00 GMT") @DateFormat({"EEE, dd MMM yyyy HH:mm:ss z"}) Date since) { log.debug("Getting content access certificate for consumer: {}", consumerUuid); Consumer consumer = consumerCurator.verifyAndLookupConsumer(consumerUuid); if (consumer.isShare()) { throw new BadRequestException(i18n.tr("Content access body " + "can not be requested for a share consumer")); } if (!consumer.getOwner().getContentAccessMode() .equals(ContentAccessCertServiceAdapter.ORG_ENV_ACCESS_MODE)) { throw new BadRequestException(i18n.tr("Content access mode does not allow this request.")); } if (!contentAccessCertService.hasCertChangedSince(consumer, since)) { return Response.status(Response.Status.NOT_MODIFIED) .entity("Not modified since date supplied.").build(); } ContentAccessListing result = new ContentAccessListing(); try { ContentAccessCertificate cac = contentAccessCertService.getCertificate(consumer); if (cac == null) { throw new BadRequestException(i18n.tr("Cannot retrieve content access certificate")); } String cert = cac.getCert(); String certificate = cert.substring(0, cert.indexOf("-----BEGIN ENTITLEMENT DATA-----\n")); String json = cert.substring(cert.indexOf("-----BEGIN ENTITLEMENT DATA-----\n")); List<String> pieces = new ArrayList<String>(); pieces.add(certificate); pieces.add(json); result.setContentListing(cac.getSerial().getId(), pieces); result.setLastUpdate(cac.getUpdated()); } catch (IOException ioe) { throw new BadRequestException(i18n.tr("Cannot retrieve content access certificate"), ioe); } catch (GeneralSecurityException gse) { throw new BadRequestException(i18n.tr("Cannot retrieve content access certificate", gse)); } return Response.ok(result, MediaType.APPLICATION_JSON).build(); }

Target:
public Response getContentAccessBody( @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid, @HeaderParam("If-Modified-Since") @DefaultValue("Thu, 01 Jan 1970 00:00:00 GMT") @DateFormat({"EEE, dd MMM yyyy HH:mm:ss z"}) Date since) { log.debug("Getting content access certificate for consumer: {}", consumerUuid); Consumer consumer = consumerCurator.verifyAndLookupConsumer(consumerUuid); if (consumer.isShare()) { throw new BadRequestException(i18n.tr("Content access body " + "can not be requested for a share consumer")); } if (consumer.getOwner().getContentAccessMode() != null && !consumer.getOwner().getContentAccessMode() .equals(ContentAccessCertServiceAdapter.ORG_ENV_ACCESS_MODE)) { throw new BadRequestException(i18n.tr("Content access mode does not allow this request.")); } if (!contentAccessCertService.hasCertChangedSince(consumer, since)) { return Response.status(Response.Status.NOT_MODIFIED) .entity("Not modified since date supplied.").build(); } ContentAccessListing result = new ContentAccessListing(); try { ContentAccessCertificate cac = contentAccessCertService.getCertificate(consumer); if (cac == null) { throw new BadRequestException(i18n.tr("Cannot retrieve content access certificate")); } String cert = cac.getCert(); String certificate = cert.substring(0, cert.indexOf("-----BEGIN ENTITLEMENT DATA-----\n")); String json = cert.substring(cert.indexOf("-----BEGIN ENTITLEMENT DATA-----\n")); List<String> pieces = new ArrayList<String>(); pieces.add(certificate); pieces.add(json); result.setContentListing(cac.getSerial().getId(), pieces); result.setLastUpdate(cac.getUpdated()); } catch (IOException ioe) { throw new BadRequestException(i18n.tr("Cannot retrieve content access certificate"), ioe); } catch (GeneralSecurityException gse) { throw new BadRequestException(i18n.tr("Cannot retrieve content access certificate", gse)); } return Response.ok(result, MediaType.APPLICATION_JSON).build(); }