davsclaus commented on code in PR #28919:
URL: https://github.com/apache/camel/pull/28919#discussion_r4445660187


##########
components/camel-duckdb/src/main/java/org/apache/camel/component/duckdb/DuckDbProducer.java:
##########
@@ -170,10 +183,16 @@ private static String resolveFilePath(Exchange exchange) {
         if (body instanceof File file) {
             return file.getAbsolutePath();
         }
-        if (body instanceof String str && ObjectHelper.isNotEmpty(str)) {
+        if (body instanceof Path path) {
+            return path.toAbsolutePath().toString();
+        }
+        String str = body != null
+                ? 
exchange.getContext().getTypeConverter().tryConvertTo(String.class, exchange, 
body)
+                : null;
+        if (ObjectHelper.isNotEmpty(str)) {
             return str.trim();
         }
-        throw new DuckDbException("Copy operation expects a file path in the 
message body (File or String)");
+        throw new DuckDbException("Copy operation expects a file path in the 
message body (File, Path or String)");

Review Comment:
   Thanks. The message now says `File, Path, String or bytes` in 36925cf989b2 
(test updated).
   
   _Claude Code on behalf of Claus Ibsen (davsclaus)_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to