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(@NonNull jakarta.mail.internet.MimeMessage aMimeMsg, @NonNull BiConsumer<String, String> aConsumer, boolean bUnifyValues) Take all headers from the MIME message and pass them to the provided consumer.static @NonNull AS4MimeMessagegenerateMimeMessage(@NonNull ESoapVersion eSoapVersion, @NonNull Document aSoapEnvelope, @Nullable com.helger.collection.commons.ICommonsList<WSS4JAttachment> aEncryptedAttachments) static @NonNull com.helger.http.header.HttpHeaderMapgetAndRemoveAllHeaders(@NonNull jakarta.mail.internet.MimeMessage aMimeMsg)
-
Method Details
-
generateMimeMessage
public static @NonNull AS4MimeMessage generateMimeMessage(@NonNull ESoapVersion eSoapVersion, @NonNull Document aSoapEnvelope, @Nullable com.helger.collection.commons.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
@ReturnsMutableCopy public static @NonNull com.helger.http.header.HttpHeaderMap getAndRemoveAllHeaders(@NonNull jakarta.mail.internet.MimeMessage aMimeMsg) throws jakarta.mail.MessagingException - Throws:
jakarta.mail.MessagingException
-