Which two code fragments are valid for adding an attachment in SAAJ? (Choose two.)
A.
AttachmentPart attachment =
request.createAttachementPart();
String stringContent = Update total;
attachment.setContent(stringContent,text/plain);
attachment.setContentID(update_total);
request.addAttachmentPart(attachment);
B.
Attachment attachment =
request.createAttachement();
String stringContent = Update total;
attachment.setContent(stringContent,text/plain);
attachment.setContentID(update_total);
request.addAttachment(attachment);
C.
URL url = new URL(http://eshop.com/products/tb.jpg);
DataHandler datahandler = new DataHandler(url);
AttachmentPart attachment =
request.createAttachmentPart(dataHandler);
attachment.setContentID (attached_image);
request.addAttachmentPart(attachment);
D.
URL url = new URL(http://eshop.com/products/tb.jpg);
DataHandler datahandler = new DataHandler(url);
Attachment attachment =
request.createAttachment(dataHandler);
attachment.setContentID (attached_image);
request.addAttachment(attachment);
E.
Attachment attachment =
request.newAttachement();
String stringContent = Update total;
attachment.setContent(stringContent,text/plain);
attachment.setContentID(update_total);
request.setAttachment(attachment);
Explanation: