@SuppressWarnings("unchecked") public static boolean checkETagValidators(final HttpServletRequest req,final HttpServletResponse resp,final Method reqMethod,final String etag){
  final List<String> ifNoneMatchList=Collections.list(req.getHeaders("If-None-Match"));
  if (ifNoneMatchList.size() > 0 && isMatchingEtag(ifNoneMatchList,etag)) {
    if (reqMethod == Method.GET || reqMethod == Method.HEAD) {
      sendNotModified(resp);
    }
 else {
      sendPreconditionFailed(resp);
    }
    return true;
  }
  final List<String> ifMatchList=Collections.list(req.getHeaders("If-Match"));
  if (ifMatchList.size() > 0 && !isMatchingEtag(ifMatchList,etag)) {
    sendPreconditionFailed(resp);
    return true;
  }
  return false;
}

@ SuppressWarnings ( "unchecked" ) public static boolean checkETagValidators ( final HttpServletRequest req , final HttpServletResponse resp , final Method reqMethod , final String etag ) { final List < String > ifNoneMatchList = Collections . list ( req . getHeaders ( "If-None-Match" ) ) ; if ( ifNoneMatchList . size ( ) > 0 && isMatchingEtag ( ifNoneMatchList , etag ) ) { if ( reqMethod == Method . GET || reqMethod == Method . HEAD ) { sendNotModified ( resp ) ; } else { sendPreconditionFailed ( resp ) ; } return true ; } final List < String > ifMatchList = Collections . list ( req . getHeaders ( "If-Match" ) ) ; if ( ifMatchList . size ( ) > 0 && ! isMatchingEtag ( ifMatchList , etag ) ) { sendPreconditionFailed ( resp ) ; return true ; } return false ; }
check for etag related conditional headers and set status
