Search in sources :

Example 1 with EmailPopulatingBuilderFactoryImpl

use of org.simplejavamail.email.internal.EmailPopulatingBuilderFactoryImpl in project simple-java-mail by bbottema.

the class EmailConverter method outlookMsgToEmailBuilder.

/**
 * @param msgInputStream The content of an Outlook (.msg) message from which to create the {@link Email}.
 */
@SuppressWarnings("deprecation")
@NotNull
public static EmailFromOutlookMessage outlookMsgToEmailBuilder(@NotNull final InputStream msgInputStream, @Nullable final Pkcs12Config pkcs12Config) {
    EmailFromOutlookMessage fromMsgBuilder = ModuleLoader.loadOutlookModule().outlookMsgToEmailBuilder(msgInputStream, new EmailStartingBuilderImpl(), new EmailPopulatingBuilderFactoryImpl(), InternalEmailConverterImpl.INSTANCE);
    decryptAttachments(fromMsgBuilder.getEmailBuilder(), fromMsgBuilder.getOutlookMessage(), pkcs12Config);
    return fromMsgBuilder;
}
Also used : EmailPopulatingBuilderFactoryImpl(org.simplejavamail.email.internal.EmailPopulatingBuilderFactoryImpl) EmailStartingBuilderImpl(org.simplejavamail.email.internal.EmailStartingBuilderImpl) EmailFromOutlookMessage(org.simplejavamail.api.internal.outlooksupport.model.EmailFromOutlookMessage) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with EmailPopulatingBuilderFactoryImpl

use of org.simplejavamail.email.internal.EmailPopulatingBuilderFactoryImpl in project simple-java-mail by bbottema.

the class EmailConverter method outlookMsgToEmailBuilder.

/**
 * @param msgFile The content of an Outlook (.msg) message from which to create the {@link Email}.
 * @param pkcs12Config Private key store for decrypting S/MIME encrypted attachments
 *                        (only needed when the message is encrypted rather than just signed).
 */
@SuppressWarnings({ "deprecation" })
@NotNull
public static EmailPopulatingBuilder outlookMsgToEmailBuilder(@NotNull final File msgFile, @Nullable final Pkcs12Config pkcs12Config) {
    checkNonEmptyArgument(msgFile, "msgFile");
    EmailFromOutlookMessage result = ModuleLoader.loadOutlookModule().outlookMsgToEmailBuilder(msgFile, new EmailStartingBuilderImpl(), new EmailPopulatingBuilderFactoryImpl(), InternalEmailConverterImpl.INSTANCE);
    return decryptAttachments(result.getEmailBuilder(), result.getOutlookMessage(), pkcs12Config);
}
Also used : EmailPopulatingBuilderFactoryImpl(org.simplejavamail.email.internal.EmailPopulatingBuilderFactoryImpl) EmailStartingBuilderImpl(org.simplejavamail.email.internal.EmailStartingBuilderImpl) EmailFromOutlookMessage(org.simplejavamail.api.internal.outlooksupport.model.EmailFromOutlookMessage) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with EmailPopulatingBuilderFactoryImpl

use of org.simplejavamail.email.internal.EmailPopulatingBuilderFactoryImpl in project simple-java-mail by bbottema.

the class EmailConverter method outlookMsgToEmail.

/**
 * @param msgData The content of an Outlook (.msg) message from which to create the {@link Email}.
 * @param pkcs12Config Private key store for decrypting S/MIME encrypted attachments
 *                        (only needed when the message is encrypted rather than just signed).
 */
@SuppressWarnings("deprecation")
@NotNull
public static Email outlookMsgToEmail(@NotNull final String msgData, @Nullable final Pkcs12Config pkcs12Config) {
    checkNonEmptyArgument(msgData, "msgFile");
    EmailFromOutlookMessage result = ModuleLoader.loadOutlookModule().outlookMsgToEmailBuilder(msgData, new EmailStartingBuilderImpl(), new EmailPopulatingBuilderFactoryImpl(), InternalEmailConverterImpl.INSTANCE);
    return decryptAttachments(result.getEmailBuilder(), result.getOutlookMessage(), pkcs12Config).buildEmail();
}
Also used : EmailPopulatingBuilderFactoryImpl(org.simplejavamail.email.internal.EmailPopulatingBuilderFactoryImpl) EmailStartingBuilderImpl(org.simplejavamail.email.internal.EmailStartingBuilderImpl) EmailFromOutlookMessage(org.simplejavamail.api.internal.outlooksupport.model.EmailFromOutlookMessage) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

NotNull (org.jetbrains.annotations.NotNull)3 EmailFromOutlookMessage (org.simplejavamail.api.internal.outlooksupport.model.EmailFromOutlookMessage)3 EmailPopulatingBuilderFactoryImpl (org.simplejavamail.email.internal.EmailPopulatingBuilderFactoryImpl)3 EmailStartingBuilderImpl (org.simplejavamail.email.internal.EmailStartingBuilderImpl)3