CAMEL-22686 Add handling of a GenericFile body to DoclingProducer.getInputPath()#19892
CAMEL-22686 Add handling of a GenericFile body to DoclingProducer.getInputPath()#19892davsclaus merged 1 commit intoapache:mainfrom
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🤖 CI automation will test this PR automatically. 🐫 Apache Camel Committers, please review the following items:
|
|
You dont need to add camel-file as dependency, but you can check for wrapped file ala You can see how this is done elsewhere such as above from aws, or do a git grep WrappedFile to find code samples. |
b9e4ea3 to
378d230
Compare
Sorry about that - removed the camel-file dependency and used WrappedFile. |
| validateFileSize(file.getAbsolutePath()); | ||
| return file.getAbsolutePath(); | ||
| } else if (body instanceof WrappedFile<?> wf) { | ||
| File file = (File) wf.getFile(); |
There was a problem hiding this comment.
You cannot type cast directly to File, as WrappedFile can also come from FTP and then its another kind, or azure file that is also type etc. So you need to do
Object f = wf.getFile
if (f instanceof File file) ...
378d230 to
f1fb4c4
Compare
Description
Add handling of a GenericFile case to DoclingProducer.getInputPath - it would allow going directly from camel-file to camel-docling.
Target
mainbranch)Tracking
Apache Camel coding standards and style
[x ] I checked that each commit in the pull request has a meaningful subject line and body.
[x ] I have run
mvn clean install -DskipTestslocally from root folder and I have committed all auto-generated changes.