Drive letter case alignment in addClassPathManifestEntries

Issue: SPR-16117
This commit is contained in:
Juergen Hoeller 2017-10-26 15:28:27 +02:00
parent a982123ed5
commit a2f5e1254e
1 changed files with 5 additions and 0 deletions

View File

@ -424,6 +424,11 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
javaClassPathProperty, System.getProperty("path.separator"))) {
try {
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
filePath = filePath.substring(0, 1).toUpperCase() + filePath.substring(1);
}
UrlResource jarResource = new UrlResource(ResourceUtils.JAR_URL_PREFIX +
ResourceUtils.FILE_URL_PREFIX + filePath + ResourceUtils.JAR_URL_SEPARATOR);
// Potentially overlapping with URLClassLoader.getURLs() result above!