Polish contribution

See gh-31598
This commit is contained in:
Sam Brannen 2023-11-14 14:39:20 +01:00
parent d5874ab99e
commit e71117dcdf
1 changed files with 2 additions and 2 deletions

View File

@ -490,8 +490,8 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
String filePath = new File(path).getAbsolutePath();
int prefixIndex = filePath.indexOf(':');
if (prefixIndex == 1) {
// Possibly "c:" drive prefix on Windows, to be upper-cased for proper duplicate detection
// to resolve find duplicate jar resource on windows
// Possibly a drive prefix on Windows (for example, "c:"), so we prepend a slash
// and convert the drive letter to uppercase for consistent duplicate detection.
filePath = "/" + StringUtils.capitalize(filePath);
}
// Since '#' can appear in directories/filenames, java.net.URL should not treat it as a fragment