Allow "set" operations, which removes all current values for this header. @param name The header name @return the message bytes container for the value
(String name)
| 337 | * @return the message bytes container for the value |
| 338 | */ |
| 339 | public MessageBytes setValue(String name) { |
| 340 | for (int i = 0; i < count; i++) { |
| 341 | if (headers[i].getName().equalsIgnoreCase(name)) { |
| 342 | for (int j = i + 1; j < count; j++) { |
| 343 | if (headers[j].getName().equalsIgnoreCase(name)) { |
| 344 | removeHeader(j--); |
| 345 | } |
| 346 | } |
| 347 | return headers[i].getValue(); |
| 348 | } |
| 349 | } |
| 350 | MimeHeaderField mh = createHeader(); |
| 351 | mh.getName().setString(name); |
| 352 | return mh.getValue(); |
| 353 | } |
| 354 | |
| 355 | // -------------------- Getting headers -------------------- |
| 356 |