public void setEntity(Representation entity) {             super.setEntity(entity);
public void setEntity(Resource resource) { List<Representation> variants = resource.getVariants();  if ((variants == null) || (variants.size() < 1)) {  setStatus(Status.CLIENT_ERROR_NOT_FOUND); } else {  Representation preferredVariant = getRequest().getClientInfo() .getPreferredVariant(variants);   getDimensions().add(Dimension.CHARACTER_SET); getDimensions().add(Dimension.ENCODING); getDimensions().add(Dimension.LANGUAGE); getDimensions().add(Dimension.MEDIA_TYPE);  if (preferredVariant == null) {  setStatus(Status.CLIENT_ERROR_NOT_ACCEPTABLE);  ReferenceList refs = new ReferenceList(variants.size()); for (Representation variant : variants) { if (variant.getIdentifier() != null) { refs.add(variant.getIdentifier()); } } this.setEntity(refs.getTextRepresentation()); } else { setEntity(preferredVariant); } }
    public void setEntity(Representation entity) {        // if (getStatus().equals(Status.SUCCESS_OK)) {        // if (getRequest().getConditions().isModified(entity)) {        // // Send the representation as the response entity        // super.setEntity(entity);        // } else {        // // Indicates to the client that he already has the best        // // representation        // setStatus(Status.REDIRECTION_NOT_MODIFIED);        // }        // } else {        // super.setEntity(entity);        // }        super.setEntity(entity);    }