|
From: <kc...@us...> - 2003-06-17 04:24:31
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/transport
In directory sc8-pr-cvs1:/tmp/cvs-serv27294/src/hk/hku/cecid/phoenix/message/transport
Modified Files:
Mail.java
Log Message:
switch to use new ebxmlMessage writeTo mechanism
Index: Mail.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/transport/Mail.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** Mail.java 15 May 2003 04:30:07 -0000 1.38
--- Mail.java 17 Jun 2003 04:24:28 -0000 1.39
***************
*** 521,538 ****
final SOAPMessage soapMessage = ebxmlMessage.getSOAPMessage();
! final boolean hasAttachments =
! soapMessage.getAttachments().hasNext();
! if (hasAttachments) {
! Utility.addContentTransferEncoding(
! soapMessage, MAIL_TRANSFER_ENCODING,
! MAIL_TRANSFER_ENCODING);
! soapMessage.saveChanges();
! }
final ByteArrayOutputStream out = new ByteArrayOutputStream();
! ebxmlMessage.writeTo(out);
! final String[] contentType = soapMessage.getMimeHeaders().
! getHeader(CONTENT_TYPE);
! String type = contentType[0];
final AttachmentDataSource content =
new AttachmentDataSource(out.toByteArray(), type);
--- 521,532 ----
final SOAPMessage soapMessage = ebxmlMessage.getSOAPMessage();
! final boolean hasAttachments = ebxmlMessage.getPayloadCount() > 0;
final ByteArrayOutputStream out = new ByteArrayOutputStream();
! ebxmlMessage.writeTo(
! out, MAIL_TRANSFER_ENCODING, MAIL_TRANSFER_ENCODING);
! String type = (String) ebxmlMessage.getMimeHeaders(
! MAIL_TRANSFER_ENCODING, MAIL_TRANSFER_ENCODING)
! .get(CONTENT_TYPE);
final AttachmentDataSource content =
new AttachmentDataSource(out.toByteArray(), type);
***************
*** 584,592 ****
throw new TransportException(ErrorMessages.getMessage(
ErrorMessages.ERR_SMTP_CANNOT_SEND_MESSAGE));
- }
-
- if (hasAttachments) {
- Utility.removeContentTransferEncoding(soapMessage);
- soapMessage.saveChanges();
}
--- 578,581 ----
|