You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GH-9594: Fix FileReadingMessageSource for FileHeaders.RELATIVE_PATH
Fixes: #9594
Issue link: #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`**
Copy file name to clipboardExpand all lines: spring-integration-file/src/test/java/org/springframework/integration/file/FileReadingMessageSourceTests.java
+25-31Lines changed: 25 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2002-2022 the original author or authors.
2
+
* Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
0 commit comments