if(bestVariant == null) {  call.setStatus(Statuses.CLIENT_ERROR_NOT_ACCEPTABLE); } else {  Date modifiedSince = (call.getCondition() == null) ? null : call.getCondition().getModifiedSince(); if((modifiedSince == null) || DateUtils.after(modifiedSince, bestVariant.getModificationDate())) {  call.setOutput(bestVariant); call.setStatus(Statuses.SUCCESS_OK); } else {  call.setStatus(Statuses.REDIRECTION_NOT_MODIFIED); } } } }
if (bestVariant == null) {  call.setStatus(Statuses.CLIENT_ERROR_NOT_ACCEPTABLE); } else {  boolean send = true;   if ((call.getCondition().getNoneMatch() != null) && (call.getCondition().getNoneMatch().size() > 0)) { boolean matched = false;   if (bestVariant.getTag() != null) {  Tag tag; for (Iterator<Tag> iter = call.getCondition().getNoneMatch().iterator(); !matched && iter.hasNext();) { tag = iter.next(); matched = tag.equals(bestVariant.getTag()) || tag.equals(Tag.ALL); } }  send = !matched; } else {  Date modifiedSince = call.getCondition().getModifiedSince(); send = ((modifiedSince == null) || (bestVariant.getModificationDate() == null) || DateUtils.after( modifiedSince, bestVariant.getModificationDate())); }  if (send) {  call.setOutput(bestVariant); call.setStatus(Statuses.SUCCESS_OK); } else {  call.setStatus(Statuses.REDIRECTION_NOT_MODIFIED); } } } }
   public void setOutput(Call call, Resource resource, Language fallbackLanguage)   {      List<Representation> variants = resource.getVariants();      if((variants == null) || (variants.size() < 1))      {         // Resource not found      	call.setStatus(Statuses.CLIENT_ERROR_NOT_FOUND);      }      else      {         // Compute the best variant      	Representation bestVariant = call.getClient().getBestVariant(variants, fallbackLanguage);         if(bestVariant == null)         {            // No variant was found matching the call preferences            call.setStatus(Statuses.CLIENT_ERROR_NOT_ACCEPTABLE);         }         else         {            // Was the representation modified since the last client call?            Date modifiedSince = (call.getCondition() == null) ? null : call.getCondition().getModifiedSince();            if((modifiedSince == null) || DateUtils.after(modifiedSince, bestVariant.getModificationDate()))            {               // Yes, set the best representation as the call output            	call.setOutput(bestVariant);            	call.setStatus(Statuses.SUCCESS_OK);            }            else            {               // No, indicates it to the client            	call.setStatus(Statuses.REDIRECTION_NOT_MODIFIED);            }         }      }   }