Skip to content

Commit

Permalink
Merge pull request #130 from assimbly/develop
Browse files Browse the repository at this point in the history
Release 5.0.1
  • Loading branch information
skin27 authored Nov 29, 2024
2 parents 5e329b3 + e44e911 commit 62e50e3
Show file tree
Hide file tree
Showing 59 changed files with 160 additions and 171 deletions.
2 changes: 1 addition & 1 deletion aggregate/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>aggregate</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion amazon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>amazon</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>auth</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion cookies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>cookies</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion csvtoxml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>csvtoxml</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion docconverter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>docconverter</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion edi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>edi</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion edifact/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>edifact</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion edifactcommon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>edifactcommon</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion edifactdotweb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>edifactdotweb</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion edifactstandards/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>edifactstandards</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion encoder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>encoder</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion enrich/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>enrich</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@ public class ZipFileEnrichStrategy implements AggregationStrategy {
public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
element_names = new ArrayList<>();

if (newExchange == null) {
// there’s no remote file to consume
return oldExchange;
}

Message in = oldExchange.getIn();
Message resource = newExchange.getIn();

byte[] sourceZip = in.getBody(byte[].class);
byte[] resourceData = resource.getBody(byte[].class);
byte[] resourceData = newExchange.getContext().getTypeConverter().convertTo(byte[].class, resource.getBody());

String fileName = resource.getHeader(Exchange.FILE_NAME, String.class);
String fileName = resource.getHeader(Exchange.FILE_NAME_CONSUMED, String.class);

ByteArrayOutputStream baos = new ByteArrayOutputStream();

Expand Down
2 changes: 1 addition & 1 deletion exceltoxml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>exceltoxml</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion flv/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>flv</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion formtoxml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>formtoxml</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion googledrive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>googledrive</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public GoogleDriveConfiguration() {
@UriParam
protected String directoryId;

@UriParam
protected String flowId;

// consumer options

@UriParam(label = "consumer")
Expand Down Expand Up @@ -106,4 +109,12 @@ public String getGSuiteFiles() {
public void setGSuiteFiles(String gSuiteFiles) {
this.gSuiteFiles = gSuiteFiles;
}

public String getFlowId() {
return flowId;
}

public void setFlowId(String flowId) {
this.flowId = flowId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ protected int poll() throws Exception {
connectionAttempts += 1;
service = this.endpoint.getClient(true);
} else {
LOG.error("GoogleJsonResponseException occurred. Connect to Google Drive directory failed:", e);
LOG.error("GoogleJsonResponseException occurred. Connect to Google Drive directory failed on flowId: "+configuration.getFlowId(), e);
}
}

Expand Down
2 changes: 1 addition & 1 deletion jsontoxmllegacy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>jsontoxmllegacy</artifactId>
Expand Down
12 changes: 3 additions & 9 deletions mail/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.0</version>
<version>5.0.1</version>
</parent>

<artifactId>mail</artifactId>
Expand All @@ -31,15 +31,9 @@
</dependency>

<dependency>
<groupId>jakarta.mail</groupId>
<artifactId>jakarta.mail-api</artifactId>
<version>${jakarta.mail.version}</version>
</dependency>

<dependency>
<groupId>com.sun.mail</groupId>
<groupId>org.eclipse.angus</groupId>
<artifactId>jakarta.mail</artifactId>
<version>2.0.1</version>
<version>${angus.mail.version}</version>
</dependency>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void populateMailMessage(MailEndpoint endpoint, MimeMessage mimeMessage,
replyToAddresses
.add(asEncodedInternetAddress(reply.trim(), determineCharSet(endpoint.getConfiguration(), exchange)));
}
mimeMessage.setReplyTo(replyToAddresses.toArray(new InternetAddress[replyToAddresses.size()]));
mimeMessage.setReplyTo(replyToAddresses.toArray(new InternetAddress[0]));
}

// must have at least one recipients otherwise we do not know where to send the mail
Expand Down Expand Up @@ -369,6 +369,10 @@ protected void extractAttachmentsFromMultipart(Multipart mp, Map<String, Attachm
} else {
String disposition = part.getDisposition();
String fileName = part.getFileName();
// fix file name if using malicious parameter name
if (fileName != null) {
fileName = fileName.replaceAll("[\n\r\t]", "_");
}

if (isAttachment(disposition) && (fileName == null || fileName.isEmpty())) {
if (generateMissingAttachmentNames != null
Expand All @@ -395,7 +399,7 @@ protected void extractAttachmentsFromMultipart(Multipart mp, Map<String, Attachm
LOG.trace("Part #{}: LineCount: {}", i, part.getLineCount());
}

if (validDisposition(disposition, fileName) || fileName != null && !fileName.isEmpty()) {
if (validDisposition(disposition, fileName) || (fileName != null && !fileName.isEmpty())) {
LOG.debug("Mail contains file attachment: {}", fileName);
if (handleDuplicateAttachmentNames != null) {
if (handleDuplicateAttachmentNames
Expand Down Expand Up @@ -831,7 +835,7 @@ private static void appendRecipientToMimeMessage(
}

mimeMessage.addRecipients(asRecipientType(type),
recipientsAddresses.toArray(new InternetAddress[recipientsAddresses.size()]));
recipientsAddresses.toArray(new InternetAddress[0]));
}

private static String[] splitRecipients(String recipients) {
Expand All @@ -858,7 +862,7 @@ protected static boolean hasAlternativeBody(MailConfiguration configuration, Exc

protected static String getAlternativeBody(MailConfiguration configuration, Exchange exchange) {
String alternativeBodyHeader = configuration.getAlternativeBodyHeader();
return exchange.getIn().getHeader(alternativeBodyHeader, String.class);
return exchange.getIn().getHeader(alternativeBodyHeader, java.lang.String.class);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import jakarta.mail.search.SearchTerm;

import com.sun.mail.imap.SortTerm;
import org.apache.camel.CamelContext;
import org.apache.camel.Endpoint;
import org.apache.camel.SSLContextParametersAware;
Expand All @@ -32,6 +31,7 @@
import org.apache.camel.support.HeaderFilterStrategyComponent;
import org.apache.camel.util.PropertiesHelper;
import org.apache.camel.util.StringHelper;
import org.eclipse.angus.mail.imap.SortTerm;

/**
* Component for JavaMail.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
import jakarta.mail.Store;
import jakarta.mail.search.SearchTerm;

import com.sun.mail.imap.IMAPFolder;
import com.sun.mail.imap.IMAPStore;
import com.sun.mail.imap.SortTerm;
import org.apache.camel.Exchange;
import org.apache.camel.ExchangePropertyKey;
import org.apache.camel.Processor;
Expand All @@ -49,6 +46,9 @@
import org.apache.camel.util.CastUtils;
import org.apache.camel.util.KeyValueHolder;
import org.apache.camel.util.ObjectHelper;
import org.eclipse.angus.mail.imap.IMAPFolder;
import org.eclipse.angus.mail.imap.IMAPStore;
import org.eclipse.angus.mail.imap.SortTerm;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
import jakarta.mail.internet.MimeMultipart;
import jakarta.mail.search.SearchTerm;

import com.sun.mail.imap.SortTerm;
import org.apache.camel.Converter;
import org.apache.camel.Exchange;
import org.apache.camel.TypeConverter;
import org.apache.camel.spi.TypeConverterRegistry;
import org.apache.camel.support.ExchangeHelper;
import org.apache.camel.util.TimeUtils;
import org.eclipse.angus.mail.imap.SortTerm;

/**
* JavaMail specific converters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import jakarta.mail.Message;
import jakarta.mail.search.SearchTerm;

import com.sun.mail.imap.SortTerm;
import org.apache.camel.Category;
import org.apache.camel.Consumer;
import org.apache.camel.Exchange;
Expand All @@ -31,6 +30,7 @@
import org.apache.camel.spi.UriEndpoint;
import org.apache.camel.spi.UriParam;
import org.apache.camel.support.ScheduledPollEndpoint;
import org.eclipse.angus.mail.imap.SortTerm;

import static org.assimbly.mail.component.mail.MailConstants.MAIL_GENERATE_MISSING_ATTACHMENT_NAMES_NEVER;
import static org.assimbly.mail.component.mail.MailConstants.MAIL_HANDLE_DUPLICATE_ATTACHMENT_NAMES_NEVER;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.apache.camel.spi.PropertyConfigurerGetter;
import org.apache.camel.spi.GeneratedPropertyConfigurer;
import org.apache.camel.support.component.PropertyConfigurerSupport;
import org.eclipse.angus.mail.imap.SortTerm;

/**
* Generated by camel build tools - do NOT edit this file!
Expand Down Expand Up @@ -124,7 +125,7 @@ public boolean configure(CamelContext camelContext, Object obj, String name, Obj
case "skipfailedmessage":
case "skipFailedMessage": target.getConfiguration().setSkipFailedMessage(property(camelContext, boolean.class, value)); return true;
case "sortterm":
case "sortTerm": target.setSortTerm(property(camelContext, com.sun.mail.imap.SortTerm[].class, value)); return true;
case "sortTerm": target.setSortTerm(property(camelContext, SortTerm[].class, value)); return true;
case "sslcontextparameters":
case "sslContextParameters": target.getConfiguration().setSslContextParameters(property(camelContext, org.apache.camel.support.jsse.SSLContextParameters.class, value)); return true;
case "startscheduler":
Expand Down Expand Up @@ -255,7 +256,7 @@ public Class<?> getOptionType(String name, boolean ignoreCase) {
case "skipfailedmessage":
case "skipFailedMessage": return boolean.class;
case "sortterm":
case "sortTerm": return com.sun.mail.imap.SortTerm[].class;
case "sortTerm": return SortTerm[].class;
case "sslcontextparameters":
case "sslContextParameters": return org.apache.camel.support.jsse.SSLContextParameters.class;
case "startscheduler":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import jakarta.mail.Message;
import jakarta.mail.MessagingException;
import jakarta.mail.internet.InternetAddress;
import org.eclipse.angus.mail.imap.SortTerm;

import com.sun.mail.imap.SortTerm;

/**
* Utility class for sorting of mail messages
Expand Down
Loading

0 comments on commit 62e50e3

Please sign in to comment.