From f1fb4c41cba7d70e7bbe5f93d4f574633c4d71a9 Mon Sep 17 00:00:00 2001 From: Tom Cunningham Date: Tue, 11 Nov 2025 18:59:25 -0500 Subject: [PATCH] CAMEL-22686 Add handling of a WrappedFile body --- .../org/apache/camel/component/docling/DoclingProducer.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/camel-ai/camel-docling/src/main/java/org/apache/camel/component/docling/DoclingProducer.java b/components/camel-ai/camel-docling/src/main/java/org/apache/camel/component/docling/DoclingProducer.java index 105d769db09b8..5e6b75f42402d 100644 --- a/components/camel-ai/camel-docling/src/main/java/org/apache/camel/component/docling/DoclingProducer.java +++ b/components/camel-ai/camel-docling/src/main/java/org/apache/camel/component/docling/DoclingProducer.java @@ -32,6 +32,7 @@ import org.apache.camel.Exchange; import org.apache.camel.InvalidPayloadException; +import org.apache.camel.WrappedFile; import org.apache.camel.support.DefaultProducer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -710,6 +711,10 @@ private String getInputPath(Exchange exchange) throws InvalidPayloadException, I File file = (File) body; validateFileSize(file.getAbsolutePath()); return file.getAbsolutePath(); + } else if (body instanceof WrappedFile wf) { + File file = (File) wf.getFile(); + validateFileSize(file.getAbsolutePath()); + return file.getAbsolutePath(); } throw new InvalidPayloadException(exchange, String.class);