@@ -365,19 +365,17 @@ protected void addAllClassLoaderJarRoots(ClassLoader classLoader, Set<Resource>
365
365
if (classLoader instanceof URLClassLoader ) {
366
366
try {
367
367
for (URL url : ((URLClassLoader ) classLoader ).getURLs ()) {
368
- if (ResourceUtils .isJarFileURL (url )) {
369
- try {
370
- UrlResource jarResource = new UrlResource (
371
- ResourceUtils .JAR_URL_PREFIX + url .toString () + ResourceUtils .JAR_URL_SEPARATOR );
372
- if (jarResource .exists ()) {
373
- result .add (jarResource );
374
- }
368
+ try {
369
+ UrlResource jarResource = new UrlResource (
370
+ ResourceUtils .JAR_URL_PREFIX + url .toString () + ResourceUtils .JAR_URL_SEPARATOR );
371
+ if (jarResource .exists ()) {
372
+ result .add (jarResource );
375
373
}
376
- catch ( MalformedURLException ex ) {
377
- if ( logger . isDebugEnabled () ) {
378
- logger .debug ( "Cannot search for matching files underneath [" + url +
379
- "] because it cannot be converted to a valid 'jar:' URL: " + ex . getMessage ());
380
- }
374
+ }
375
+ catch ( MalformedURLException ex ) {
376
+ if ( logger .isDebugEnabled ()) {
377
+ logger . debug ( "Cannot search for matching files underneath [ " + url +
378
+ "] because it cannot be converted to a valid 'jar:' URL: " + ex . getMessage ());
381
379
}
382
380
}
383
381
}
@@ -418,20 +416,20 @@ protected void addAllClassLoaderJarRoots(ClassLoader classLoader, Set<Resource>
418
416
protected void addClassPathManifestEntries (Set <Resource > result ) {
419
417
try {
420
418
String javaClassPathProperty = System .getProperty ("java.class.path" );
421
- for (String url : StringUtils .delimitedListToStringArray (
419
+ for (String path : StringUtils .delimitedListToStringArray (
422
420
javaClassPathProperty , System .getProperty ("path.separator" ))) {
423
421
try {
424
- if ( url . endsWith ( ResourceUtils . JAR_FILE_EXTENSION )) {
425
- UrlResource jarResource = new UrlResource (ResourceUtils .JAR_URL_PREFIX +
426
- ResourceUtils .FILE_URL_PREFIX + url + ResourceUtils . JAR_URL_SEPARATOR );
427
- if ( jarResource . exists ()) {
428
- result . add (jarResource );
429
- }
422
+ File file = new File ( path );
423
+ UrlResource jarResource = new UrlResource (ResourceUtils .JAR_URL_PREFIX +
424
+ ResourceUtils .FILE_URL_PREFIX + file . getAbsolutePath () +
425
+ ResourceUtils . JAR_URL_SEPARATOR );
426
+ if (jarResource . exists ()) {
427
+ result . add ( jarResource );
430
428
}
431
429
}
432
430
catch (MalformedURLException ex ) {
433
431
if (logger .isDebugEnabled ()) {
434
- logger .debug ("Cannot search for matching files underneath [" + url +
432
+ logger .debug ("Cannot search for matching files underneath [" + path +
435
433
"] because it cannot be converted to a valid 'jar:' URL: " + ex .getMessage ());
436
434
}
437
435
}
0 commit comments