Map<String,List<String>> result = new HashMap<String,List<String>>();
StringBuffer cookies = new StringBuffer();
for (Cookie cookie : store) {
if (cookie.isExpired()) {
store.remove(cookie);
}
else if (cookie.matches(uri)) {
if (cookies.length() != 0) cookies.append(", ");
cookies.append(cookie.toExternalForm());
}
}
if (cookies.length() > 0) {
List<String> temp = new ArrayList<String>(1);
temp.add(cookies.toString());
result.put("Cookie", temp);
}
return result;