private static boolean isJarURL ( final URL rootDirResource ) { final String protocol = rootDirResource . getProtocol ( ) ; /** * Determine whether the given URL points to a resource in a jar file, that is, has protocol "jar", "zip", * "wsjar" or "code-source". * <p> * "zip" and "wsjar" are used by BEA WebLogic Server and IBM WebSphere, respectively, but can be treated like * jar files. The same applies to "code-source" URLs on Oracle OC4J, provided that the path contains a jar * separator. * * */ return "jar" . equals ( protocol ) || "zip" . equals ( protocol ) || "wsjar" . equals ( protocol ) || ( "code-source" . equals ( protocol ) && rootDirResource . getPath ( ) . contains ( JAR_URL_SEPARATOR ) ) ; }
check if the URL of the Rousource is a JAR resource .