Files
spring-integration/spring-integration-file
Artem Bilan 44d035fcaa GH-9594: Fix FileReadingMessageSource for FileHeaders.RELATIVE_PATH
Fixes: #9594
Issue link: https://github.com/spring-projects/spring-integration/issues/9594

The `String.replaceFirst()` for directory with `[]` or `()` leads to a regex execution
which does not really replace the root path because of mismatch between regex and file path.
Essentially, the `Matcher.quoteReplacement()` does not do the trick we would expect from it.

* Use `Path.relativize()` API instead which works in canonical paths and proper file separators

(cherry picked from commit 91494094ac)
2024-10-25 17:30:13 +00:00
..