davsclaus opened a new pull request, #26614:
URL: https://github.com/apache/camel/pull/26614

   ## Description
   
   A route reading from the directory the application runs in never delivered a 
file and never said why:
   
   ```yaml
   - route:
       from:
         uri: "file:.?noop=true&include=order.json"
         steps:
           - log: "READ ${header.CamelFileName}"
   ```
   
   The route started and stayed silent; `file:./` the same; a `pollEnrich` with 
`file://.?fileName=order.json` returned null. `file:sub` and an absolute path 
work.
   
   Cause: `FileConsumer.listFiles` returns nothing when the directory is hidden 
and hidden directories are not included, and `new File(".").isHidden()` is 
true, because `java.io.File.isHidden` only looks at whether the name starts 
with a dot. The current directory (and `..`) is not hidden; its name is.
   
   The fix exempts `.`, `..` and an empty name from that check. Sub-directories 
keep the existing rule in `isMatchedHiddenFile` (a sub-directory named with a 
leading dot is hidden).
   
   Found by a local model in the round-2 benchmark on the camel-jbang-examples 
ladder: two of six examples read a file next to the route with `file:.` and got 
no output and no message. A person writing the same gets the same silence.
   
   ## Tests
   
   - `FileConsumeCurrentDirTest` (camel-core, where the file consumer tests 
live): `file:.` and `file:./` with an `include` on a file created in the 
working directory. Fails 2/2 without the fix, passes with it.
   - `FileConsumeHiddenDirsTest` and `FileConsumeHiddenFilesTest` still pass.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj


-- 
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