Browse Source

Merge branch '6.0.x'

pull/31608/head
Sam Brannen 1 year ago
parent
commit
978e81e72e
  1. 5
      spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java

5
spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java

@ -490,8 +490,9 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
String filePath = new File(path).getAbsolutePath(); String filePath = new File(path).getAbsolutePath();
int prefixIndex = filePath.indexOf(':'); int prefixIndex = filePath.indexOf(':');
if (prefixIndex == 1) { if (prefixIndex == 1) {
// Possibly "c:" drive prefix on Windows, to be upper-cased for proper duplicate detection // Possibly a drive prefix on Windows (for example, "c:"), so we prepend a slash
filePath = StringUtils.capitalize(filePath); // 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 // Since '#' can appear in directories/filenames, java.net.URL should not treat it as a fragment
filePath = StringUtils.replace(filePath, "#", "%23"); filePath = StringUtils.replace(filePath, "#", "%23");

Loading…
Cancel
Save