Skip to content

Commit a167a1b

Browse files
committed
JBoss "vfszip" resources need to be treated as jar URLs
Issue: SPR-11676 (cherry picked from commit 196f629)
1 parent 9e1631d commit a167a1b

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

spring-core/src/main/java/org/springframework/util/ResourceUtils.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 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.
@@ -66,15 +66,15 @@ public abstract class ResourceUtils {
6666
/** URL protocol for an entry from a zip file: "zip" */
6767
public static final String URL_PROTOCOL_ZIP = "zip";
6868

69+
/** URL protocol for an entry from a WebSphere jar file: "wsjar" */
70+
public static final String URL_PROTOCOL_WSJAR = "wsjar";
71+
6972
/** URL protocol for an entry from a JBoss jar file: "vfszip" */
7073
public static final String URL_PROTOCOL_VFSZIP = "vfszip";
7174

7275
/** URL protocol for a JBoss VFS resource: "vfs" */
7376
public static final String URL_PROTOCOL_VFS = "vfs";
7477

75-
/** URL protocol for an entry from a WebSphere jar file: "wsjar" */
76-
public static final String URL_PROTOCOL_WSJAR = "wsjar";
77-
7878
/** Separator between JAR URL and file path within the JAR */
7979
public static final String JAR_URL_SEPARATOR = "!/";
8080

@@ -252,7 +252,7 @@ public static File getFile(URI resourceUri, String description) throws FileNotFo
252252
*/
253253
public static boolean isFileURL(URL url) {
254254
String protocol = url.getProtocol();
255-
return (URL_PROTOCOL_FILE.equals(protocol) || protocol.startsWith(URL_PROTOCOL_VFS));
255+
return (URL_PROTOCOL_FILE.equals(protocol) || URL_PROTOCOL_VFS.equals(protocol));
256256
}
257257

258258
/**
@@ -264,8 +264,9 @@ public static boolean isFileURL(URL url) {
264264
* @return whether the URL has been identified as a JAR URL
265265
*/
266266
public static boolean isJarURL(URL url) {
267-
String up = url.getProtocol();
268-
return (URL_PROTOCOL_JAR.equals(up) || URL_PROTOCOL_ZIP.equals(up) || URL_PROTOCOL_WSJAR.equals(up));
267+
String protocol = url.getProtocol();
268+
return (URL_PROTOCOL_JAR.equals(protocol) || URL_PROTOCOL_ZIP.equals(protocol) ||
269+
URL_PROTOCOL_WSJAR.equals(protocol) || URL_PROTOCOL_VFSZIP.equals(protocol));
269270
}
270271

271272
/**

0 commit comments

Comments
 (0)