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

      @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.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

      @Nonnull @ReturnsMutableCopy public static com.helger.commons.http.HttpHeaderMap getAndRemoveAllHeaders(@Nonnull jakarta.mail.internet.MimeMessage aMimeMsg) throws jakarta.mail.MessagingException
      Throws:
      jakarta.mail.MessagingException