1
1
/*
2
- * Copyright 2002-2016 the original author or authors.
2
+ * Copyright 2002-2017 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -63,6 +63,9 @@ public abstract class ResourceUtils {
63
63
/** URL protocol for an entry from a jar file: "jar" */
64
64
public static final String URL_PROTOCOL_JAR = "jar" ;
65
65
66
+ /** URL protocol for an entry from a war file: "war" */
67
+ public static final String URL_PROTOCOL_WAR = "war" ;
68
+
66
69
/** URL protocol for an entry from a zip file: "zip" */
67
70
public static final String URL_PROTOCOL_ZIP = "zip" ;
68
71
@@ -258,7 +261,7 @@ public static File getFile(URI resourceUri, String description) throws FileNotFo
258
261
259
262
/**
260
263
* Determine whether the given URL points to a resource in the file system,
261
- * that is, has protocol "file", "vfsfile" or "vfs".
264
+ * i.e. has protocol "file", "vfsfile" or "vfs".
262
265
* @param url the URL to check
263
266
* @return whether the URL has been identified as a file system URL
264
267
*/
@@ -269,15 +272,16 @@ public static boolean isFileURL(URL url) {
269
272
}
270
273
271
274
/**
272
- * Determine whether the given URL points to a resource in a jar file,
273
- * that is, has protocol "jar", "zip", "vfszip" or "wsjar".
275
+ * Determine whether the given URL points to a resource in a jar file.
276
+ * i.e. has protocol "jar", "war, " "zip", "vfszip" or "wsjar".
274
277
* @param url the URL to check
275
278
* @return whether the URL has been identified as a JAR URL
276
279
*/
277
280
public static boolean isJarURL (URL url ) {
278
281
String protocol = url .getProtocol ();
279
- return (URL_PROTOCOL_JAR .equals (protocol ) || URL_PROTOCOL_ZIP .equals (protocol ) ||
280
- URL_PROTOCOL_VFSZIP .equals (protocol ) || URL_PROTOCOL_WSJAR .equals (protocol ));
282
+ return (URL_PROTOCOL_JAR .equals (protocol ) || URL_PROTOCOL_WAR .equals (protocol ) ||
283
+ URL_PROTOCOL_ZIP .equals (protocol ) || URL_PROTOCOL_VFSZIP .equals (protocol ) ||
284
+ URL_PROTOCOL_WSJAR .equals (protocol ));
281
285
}
282
286
283
287
/**
0 commit comments