You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2023/11/23 14:19:09 UTC
(camel-quarkus) 01/02: Fix MailTest.testAttachments test on Windows
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch 3.2.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 7eef399b368ae03de8f9285aa89abb97ee6d3dc4
Author: James Netherton <ja...@gmail.com>
AuthorDate: Wed Nov 22 09:50:58 2023 +0000
Fix MailTest.testAttachments test on Windows
Fixes #5536
---
.../java/org/apache/camel/quarkus/component/mail/CamelResource.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/integration-tests/mail/src/main/java/org/apache/camel/quarkus/component/mail/CamelResource.java b/integration-tests/mail/src/main/java/org/apache/camel/quarkus/component/mail/CamelResource.java
index 6da11d7f74..206859c65c 100644
--- a/integration-tests/mail/src/main/java/org/apache/camel/quarkus/component/mail/CamelResource.java
+++ b/integration-tests/mail/src/main/java/org/apache/camel/quarkus/component/mail/CamelResource.java
@@ -18,6 +18,8 @@ package org.apache.camel.quarkus.component.mail;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
@@ -102,7 +104,7 @@ public class CamelResource {
AttachmentMessage in = exchange.getMessage(AttachmentMessage.class);
DefaultAttachment attachment;
- if (fileName.startsWith("/")) {
+ if (Files.exists(Paths.get(fileName))) {
attachment = new DefaultAttachment(new FileDataSource(fileName));
} else {
attachment = new DefaultAttachment(