Files
spring-integration/spring-integration-file
Artem Bilan 91494094ac 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

**Auto-cherry-pick to `6.3.x` & `6.2.x`**
2024-10-25 13:29:47 -04:00
..