Matches the given ETag value against the given ETags. A match is found if the given ETag is not null, and either the ETags contain a " " value, or one of them is identical to the given ETag. If strong comparison is used, tags beginning with the weak ETag prefix "W/" never match. See RFC2616#3.11, RF
(boolean strong, String[] etags, String etag)
| 2834 | * @return true if the ETag is matched, false otherwise |
| 2835 | */ |
| 2836 | public static boolean match(boolean strong, String[] etags, String etag) { |
| 2837 | if (etag == null || strong && etag.startsWith("W/")) |
| 2838 | return false; |
| 2839 | for (String e : etags) |
| 2840 | if (e.equals("*") || (e.equals(etag) && !(strong && (e.startsWith("W/"))))) |
| 2841 | return true; |
| 2842 | return false; |
| 2843 | } |
| 2844 | |
| 2845 | /** |
| 2846 | * Calculates the appropriate response status for the given request and |
no outgoing calls
no test coverage detected