From fe57f74c1aa0063e0ccc9739b95078ccf0505a2c Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 14 Feb 2012 18:26:56 +0100 Subject: [PATCH] PathMatchingResourcePatternResolver preserves caching for JNLP jar connections (SPR-9117) --- .../core/io/support/PathMatchingResourcePatternResolver.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.springframework.core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java b/org.springframework.core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java index a9d473da2a..92716e491a 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java +++ b/org.springframework.core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -433,7 +433,7 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol if (con instanceof JarURLConnection) { // Should usually be the case for traditional JAR files. JarURLConnection jarCon = (JarURLConnection) con; - jarCon.setUseCaches(false); + jarCon.setUseCaches(jarCon.getClass().getName().startsWith("JNLP")); jarFile = jarCon.getJarFile(); jarFileUrl = jarCon.getJarFileURL().toExternalForm(); JarEntry jarEntry = jarCon.getJarEntry();