"(probably deleted).");
throw new HTTPException (reply);
}
}
// negotiate etag
HttpEntityTag etag = request.getETag();
HttpEntityTag etags[] = request.getIfMatch();
// gather the etags
if (etags == null && etag != null) {
etags = new HttpEntityTag[1];
etags[0] = etag;
} else if (etag != null) {
HttpEntityTag t_etags[] = new HttpEntityTag[etags.length+1];
System.arraycopy(etags, 0, t_etags, 0, etags.length);
t_etags[etags.length] = etag;
etags = t_etags;
}
if (etags != null) {
// yeah go for it!
FramedResource resource;
HttpEntityTag frametag;
for (int i = 0 ; i < variants.length ; i++) {
try {
resource = (FramedResource)variants[i].unsafeLock() ;
itsframe = (HTTPFrame)resource.getFrame(httpFrameClass);
if (itsframe != null) {
frametag = itsframe.getETag();
if (frametag == null) {
continue;
}
// Do we have a winner?
try {
for (int j=0; j<etags.length; j++)
if(frametag.getTag().equals(etags[j].getTag()))
return variants[i];
} catch (NullPointerException ex) {
// if the list of etag contains a null
// it should never happen and the try doesn't cost
}