public static void populateMapFromString(MultivaluedMap<String, String> params, Message m, String postBody, String enc, boolean decode) { List<String> parts = Arrays.asList(StringUtils.split(postBody, "&")); checkNumberOfParts(m, parts.size()); for (String part : parts) { String[] keyValue = new String[2]; int index = part.indexOf("="); if (index != -1) { keyValue[0] = part.substring(0, index); keyValue[1] = index + 1 < part.length() ? part.substring(index + 1) : ""; } else { keyValue[0] = part; keyValue[1] = ""; } String name = HttpUtils.urlDecode(keyValue[0], enc); if (decode) { params.add(name, HttpUtils.urlDecode(keyValue[1], enc)); } else { params.add(name, keyValue[1]); } } }
public static void populateMapFromString(MultivaluedMap<String, String> params, Message m, String postBody, String enc, boolean decode) { if (StringUtils.isEmpty(postBody)) { return; } String[] parts = postBody.split("&"); checkNumberOfParts(m, parts.length); for (String part : parts) { String[] keyValue = new String[2]; int index = part.indexOf("="); if (index != -1) { keyValue[0] = part.substring(0, index); keyValue[1] = index + 1 < part.length() ? part.substring(index + 1) : ""; } else { keyValue[0] = part; keyValue[1] = ""; } String name = HttpUtils.urlDecode(keyValue[0], enc); if (decode) { params.add(name, HttpUtils.urlDecode(keyValue[1], enc)); } else { params.add(name, keyValue[1]); } } }
boolean decode) { List<Attachment> atts = body.getAllAttachments(); checkNumberOfParts(m, atts.size()); for (Attachment a : atts) { ContentDisposition cd = a.getContentDisposition();
boolean decode) { List<Attachment> atts = body.getAllAttachments(); checkNumberOfParts(m, atts.size()); for (Attachment a : atts) { ContentDisposition cd = a.getContentDisposition();