So wrote this test code:
public void testEtag()
{
HttpFields fields = new HttpFields();
fields.add("ETag", "W/\"11111\",W/22222");
fields.add("ETag", "W/\"33333\"");
System.err.println("Collections.list(fields.getValues(\"Etag\"))");
Collections.list(fields.getValues("Etag")).forEach(System.err::println);
System.err.println("Collections.list(fields.getValues(\"Etag\", \",\"))");
Collections.list(fields.getValues("Etag",
",")).forEach(System.err::println);
System.err.println("fields.getCSV(\"Etag\", false)");
fields.getCSV("Etag", false).forEach(System.err::println);
System.err.println("fields.getCSV(\"Etag\", true)");
fields.getCSV("Etag", true).forEach(System.err::println);
}
which cage the output:
Collections.list(fields.getValues("Etag"))
W/"11111",W/22222
W/"33333"
Collections.list(fields.getValues("Etag", ","))
W/11111
W/22222
W/33333
fields.getCSV("Etag", false)
W/11111
W/22222
W/33333
fields.getCSV("Etag", true)
W/"11111"
W/22222
W/"33333"
So fields.getCSV("Etag", true) is the method you want.
Note also that fields.getValues("Etag", ",") is deprecated!
--
Greg Wilkins <[email protected]> CTO http://webtide.com
_______________________________________________
jetty-users mailing list
[email protected]
To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users