/** * Returns the conditional status of a variant using a given method. * * @param method * The request method. * @param representationInfo * The representation information that will be tested. * @return Null if the requested method can be performed, the status of the * response otherwise. */ public Status getStatus(Method method, RepresentationInfo representationInfo) { return getStatus( method, representationInfo != null, (representationInfo == null) ? null : representationInfo .getTag(), (representationInfo == null) ? null : representationInfo.getModificationDate()); }
/** * Evaluates the preconditions of the current request against the given last * modified date and / or the given entity tag. This method does not check, * if the arguments are not null. * * @param lastModified * @param entityTag * @return * @see Request#evaluateConditions(Tag, Date) */ private ResponseBuilder evaluatePreconditionsInternal( final Date lastModified, final EntityTag entityTag) { Status status = this.request.getConditions().getStatus( this.request.getMethod(), true, Converter.toRestletTag(entityTag), lastModified); if (status == null) return null; if (status.equals(Status.REDIRECTION_NOT_MODIFIED)) { final ResponseBuilder rb = Response.notModified(); rb.lastModified(lastModified); rb.tag(entityTag); return rb; } return Response.status(STATUS_PREC_FAILED); }
final Status status = getRequest().getConditions().getStatus( getRequest().getMethod(), getRepresentation(preferredVariant));
final Status status = getRequest().getConditions().getStatus( getRequest().getMethod(), getRepresentation(preferredVariant));
.getStatus(getRequest().getMethod(), selectedRepresentation);