contentLocation = headers.getHeader(HTTPConstants.HEADER_CONTENT_LOCATION, null);
if (contentLocation != null) contentLocation = contentLocation.trim();
contentTransferEncoding = headers.getHeader(HTTPConstants.HEADER_CONTENT_TRANSFER_ENCODING , null);
if (contentTransferEncoding != null ) contentTransferEncoding = contentTransferEncoding.trim();
DataHandler dh= new DataHandler(new ManagedMemoryDataSource(boundaryDelimitedStream, 1024, contentType, true));
AttachmentPart ap= new AttachmentPart(dh);
if(contentId != null)
ap.addMimeHeader(HTTPConstants.HEADER_CONTENT_ID, contentId);