Class AS4MimeMessageHelper

java.lang.Object
com.helger.phase4.messaging.mime.AS4MimeMessageHelper

public final class AS4MimeMessageHelper extends Object
Helper class for MIME message activities.
Old name before v3: MimeMessageCreator
Author:
Philip Helger
  • 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.MessagingException
      Take 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 be null.
      aConsumer - The consumer to be invoked. May not be null.
      bUnifyValues - true to 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