}
addHeader(HeaderConstants.HEADER_HOST, host, headers);
}
Conditions conditions = request.getConditions();
addHeader(HeaderConstants.HEADER_IF_MATCH,
TagWriter.write(conditions.getMatch()), headers);
addHeader(HeaderConstants.HEADER_IF_NONE_MATCH,
TagWriter.write(conditions.getNoneMatch()), headers);
if (conditions.getModifiedSince() != null) {
addHeader(HeaderConstants.HEADER_IF_MODIFIED_SINCE,
DateWriter.write(conditions.getModifiedSince()), headers);
}
if (conditions.getRangeTag() != null
&& conditions.getRangeDate() != null) {
Context.getCurrentLogger()
.log(Level.WARNING,
"Unable to format the HTTP If-Range header due to the presence of both entity tag and modification date.");
} else if (conditions.getRangeTag() != null) {
addHeader(HeaderConstants.HEADER_IF_RANGE,
TagWriter.write(conditions.getRangeTag()), headers);
} else if (conditions.getRangeDate() != null) {
addHeader(HeaderConstants.HEADER_IF_RANGE,
DateWriter.write(conditions.getRangeDate()), headers);
}
if (conditions.getUnmodifiedSince() != null) {
addHeader(HeaderConstants.HEADER_IF_UNMODIFIED_SINCE,
DateWriter.write(conditions.getUnmodifiedSince()), headers);
}
if (request.getMaxForwards() > -1) {
addHeader(HeaderConstants.HEADER_MAX_FORWARDS,
Integer.toString(request.getMaxForwards()), headers);