11/*
2- * Copyright 2002-2016 the original author or authors.
2+ * Copyright 2002-2017 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.
3535 * object, which in turn allows one to obtain a {@code java.io.File} in the
3636 * file system through its {@code getFile()} method.
3737 *
38- * <p>The main reason for these utility methods for resource location handling
39- * is to support {@link Log4jConfigurer}, which must be able to resolve
40- * resource locations <i>before the logging system has been initialized</i>.
41- * Spring's {@code Resource} abstraction in the core package, on the other hand,
42- * already expects the logging system to be available.
43- *
4438 * @author Juergen Hoeller
4539 * @since 1.1.5
4640 * @see org.springframework.core.io.Resource
@@ -69,6 +63,9 @@ public abstract class ResourceUtils {
6963 /** URL protocol for an entry from a jar file: "jar" */
7064 public static final String URL_PROTOCOL_JAR = "jar" ;
7165
66+ /** URL protocol for an entry from a war file: "war" */
67+ public static final String URL_PROTOCOL_WAR = "war" ;
68+
7269 /** URL protocol for an entry from a zip file: "zip" */
7370 public static final String URL_PROTOCOL_ZIP = "zip" ;
7471
@@ -264,7 +261,7 @@ public static File getFile(URI resourceUri, String description) throws FileNotFo
264261
265262 /**
266263 * Determine whether the given URL points to a resource in the file system,
267- * that is, has protocol "file", "vfsfile" or "vfs".
264+ * i.e. has protocol "file", "vfsfile" or "vfs".
268265 * @param url the URL to check
269266 * @return whether the URL has been identified as a file system URL
270267 */
@@ -275,15 +272,16 @@ public static boolean isFileURL(URL url) {
275272 }
276273
277274 /**
278- * Determine whether the given URL points to a resource in a jar file,
279- * 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".
280277 * @param url the URL to check
281278 * @return whether the URL has been identified as a JAR URL
282279 */
283280 public static boolean isJarURL (URL url ) {
284281 String protocol = url .getProtocol ();
285- return (URL_PROTOCOL_JAR .equals (protocol ) || URL_PROTOCOL_ZIP .equals (protocol ) ||
286- 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 ));
287285 }
288286
289287 /**
0 commit comments