Skip to content

Commit fe57f74

Browse files
committed
PathMatchingResourcePatternResolver preserves caching for JNLP jar connections (SPR-9117)
1 parent 81861ca commit fe57f74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

org.springframework.core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2010 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -433,7 +433,7 @@ protected Set<Resource> doFindPathMatchingJarResources(Resource rootDirResource,
433433
if (con instanceof JarURLConnection) {
434434
// Should usually be the case for traditional JAR files.
435435
JarURLConnection jarCon = (JarURLConnection) con;
436-
jarCon.setUseCaches(false);
436+
jarCon.setUseCaches(jarCon.getClass().getName().startsWith("JNLP"));
437437
jarFile = jarCon.getJarFile();
438438
jarFileUrl = jarCon.getJarFileURL().toExternalForm();
439439
JarEntry jarEntry = jarCon.getJarEntry();

0 commit comments

Comments
 (0)