* and succeeded, <strong>0</strong> otherwise.
*/
public int checkIfNoneMatch(Request request) {
String setag = getETag();
HttpEntityTag etag = null;
// Check for an If-None-Match conditional:
HttpEntityTag tags[] = request.getIfNoneMatch();
if (setag != null) {
etag = HttpFactory.parseETag(getETag());
}
if ( tags != null ) {
if ( etag == null ) {
return COND_OK;
}
int status = COND_OK;
for (int i = 0 ; i < tags.length ; i++) {
HttpEntityTag t = tags[i];
if (t.getTag().equals(etag.getTag())) {
// if (t.isWeak() && !etag.isWeak()) {
if (t.isWeak() || etag.isWeak()) {
status = COND_WEAK;
} else {
return COND_FAILED;
}
}
if (t.getTag().equals("*")) {
return COND_FAILED;
}
}
return status;
}