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

   This fixes [CAMEL-24415](https://issues.apache.org/jira/browse/CAMEL-24415).
   
   `GenericFile.normalizePathToProtocol()` rewrote both separators 
unconditionally:
   
   ```java
   path = path.replace('/', getFileSeparator());
   path = path.replace('\\', getFileSeparator());
   ```
   
   On POSIX a backslash is a legal file-name character, so a single-component 
file name containing backslashes was rewritten into a multi-component relative 
path. The method is applied in `setFileName()`, `setRelativeFilePath()` and 
when building the `CamelFilePath` header, so downstream strategies that resolve 
the file name against the endpoint directory — delete, move, done-file/marker 
handling — then operated on a different path than the one that was actually 
read.
   
   Only the portable forward slash is now translated to the protocol separator. 
On Windows the separator is already a backslash, so translating the forward 
slash alone is sufficient (the previous second replace was a no-op there); on 
POSIX the backslash is preserved.
   
   **Test:** `GenericFileNormalizePathTest` (disabled on Windows, where a 
backslash *is* a separator) sets a file name and a relative path containing a 
backslash and asserts it survives; it fails against the previous code, which 
split the name on the backslash.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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