Skip to content

Commit

Permalink
feature(s3-connector): checkpoint s3 connector; pom commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mathias-vandaele committed Dec 4, 2024
1 parent 5733bcf commit c6da398
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
4 changes: 4 additions & 0 deletions bundle/default-bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connector-aws-bedrock</artifactId>
</dependency>
<dependency>
<groupId>io.camunda.connector</groupId>
<artifactId>connector-aws-s3</artifactId>
</dependency>
<dependency>
<groupId>io.camunda.connector</groupId>
<artifactId>connector-aws-textract</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@
<artifactId>connector-aws-sagemaker</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.camunda.connector</groupId>
<artifactId>connector-aws-s3</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.camunda.connector</groupId>
<artifactId>connector-email</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
import io.camunda.connector.email.outbound.protocols.actions.SortFieldPop3;
import io.camunda.connector.email.outbound.protocols.actions.SortOrder;
import jakarta.mail.*;
import jakarta.mail.internet.ContentType;
import jakarta.mail.internet.MimeMultipart;
import jakarta.validation.constraints.NotNull;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.time.OffsetDateTime;
Expand All @@ -32,9 +34,9 @@

public class JakartaUtils {

public static final String HTML_CHARSET = "text/html; charset=utf-8";
private static final Logger LOGGER = LoggerFactory.getLogger(JakartaUtils.class);
private static final String REGEX_PATH_SPLITTER = "[./]";
public static final String HTML_CHARSET = "text/html; charset=utf-8";

public Session createSession(Configuration configuration) {
return Session.getInstance(
Expand Down Expand Up @@ -282,11 +284,19 @@ private void processBodyPart(
throws MessagingException, IOException {
BodyPart bodyPart = multipart.getBodyPart(i);
switch (bodyPart.getContent()) {
case InputStream attachment when bodyPart
.getDisposition()
.equalsIgnoreCase(Part.ATTACHMENT) ->
case InputStream attachment when Part.ATTACHMENT.equalsIgnoreCase(
bodyPart.getDisposition()) ->
emailBodyBuilder.addAttachment(
new EmailAttachment(
attachment,
bodyPart.getFileName(),
new ContentType(bodyPart.getContentType()).getBaseType()));
case String textAttachment when Part.ATTACHMENT.equalsIgnoreCase(bodyPart.getDisposition()) ->
emailBodyBuilder.addAttachment(
new EmailAttachment(attachment, bodyPart.getFileName(), bodyPart.getContentType()));
new EmailAttachment(
new ByteArrayInputStream(textAttachment.getBytes()),
bodyPart.getFileName(),
new ContentType(bodyPart.getContentType()).getBaseType()));
case String plainText when bodyPart.isMimeType("text/plain") ->
emailBodyBuilder.withBodyAsPlainText(plainText);
case String html when bodyPart.isMimeType("text/html") ->
Expand Down
1 change: 0 additions & 1 deletion connectors/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<module>soap</module>
<module>webhook</module>
<module>idp-extraction</module>
<module>aws/aws-s3</module>
</modules>

<properties>
Expand Down

0 comments on commit c6da398

Please sign in to comment.