if (ifm!=null)
{
boolean match=false;
if (content.getETagValue()!=null)
{
QuotedStringTokenizer quoted = new QuotedStringTokenizer(ifm,", ",false,true);
while (!match && quoted.hasMoreTokens())
{
String tag = quoted.nextToken();
if (content.getETagValue().equals(tag))
match=true;
}
}
if (!match)
{
response.setStatus(HttpServletResponse.SC_PRECONDITION_FAILED);
return false;
}
}
if (ifnm!=null && content.getETagValue()!=null)
{
// Look for Gzip'd version of etag
if (content.getETagValue().equals(request.getAttribute("o.e.j.s.Gzip.ETag")))
{
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
response.setHeader(HttpHeader.ETAG.asString(),ifnm);
return false;
}
// Handle special case of exact match.
if (content.getETagValue().equals(ifnm))
{
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
response.setHeader(HttpHeader.ETAG.asString(),content.getETagValue());
return false;
}
// Handle list of tags
QuotedStringTokenizer quoted = new QuotedStringTokenizer(ifnm,", ",false,true);
while (quoted.hasMoreTokens())
{
String tag = quoted.nextToken();
if (content.getETagValue().equals(tag))
{
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
response.setHeader(HttpHeader.ETAG.asString(),content.getETagValue());
return false;