Package com.helger.phase4.messaging.mime
Class AS4MimeMessageHelper
java.lang.Object
com.helger.phase4.messaging.mime.AS4MimeMessageHelper
Helper class for MIME message activities.
Old name before v3:
Old name before v3:
MimeMessageCreator- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidforEachHeaderAndRemoveAfterwards(jakarta.mail.internet.MimeMessage aMimeMsg, BiConsumer<String, String> aConsumer, boolean bUnifyValues) Take all headers from the MIME message and pass them to the provided consumer.static AS4MimeMessagegenerateMimeMessage(ESoapVersion eSoapVersion, Document aSoapEnvelope, com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> aEncryptedAttachments) static com.helger.commons.http.HttpHeaderMapgetAndRemoveAllHeaders(jakarta.mail.internet.MimeMessage aMimeMsg)
-
Method Details
-
generateMimeMessage
@Nonnull public static AS4MimeMessage generateMimeMessage(@Nonnull ESoapVersion eSoapVersion, @Nonnull Document aSoapEnvelope, @Nullable com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> aEncryptedAttachments) throws jakarta.mail.MessagingException - Throws:
jakarta.mail.MessagingException
-
forEachHeaderAndRemoveAfterwards
public static void forEachHeaderAndRemoveAfterwards(@Nonnull jakarta.mail.internet.MimeMessage aMimeMsg, @Nonnull BiConsumer<String, String> aConsumer, boolean bUnifyValues) throws jakarta.mail.MessagingExceptionTake all headers from the MIME message and pass them to the provided consumer. Afterwards remove all headers from the MIME message itself.- Parameters:
aMimeMsg- The message to use. May not benull.aConsumer- The consumer to be invoked. May not benull.bUnifyValues-trueto unify the HTTP header values before passing them to the consumer.- Throws:
jakarta.mail.MessagingException- In case of MIME message processing problems
-
getAndRemoveAllHeaders
@Nonnull @ReturnsMutableCopy public static com.helger.commons.http.HttpHeaderMap getAndRemoveAllHeaders(@Nonnull jakarta.mail.internet.MimeMessage aMimeMsg) throws jakarta.mail.MessagingException - Throws:
jakarta.mail.MessagingException
-