Example usage for org.springframework.util ResourceUtils URL_PROTOCOL_WSJAR

List of usage examples for org.springframework.util ResourceUtils URL_PROTOCOL_WSJAR

Introduction

In this page you can find the example usage for org.springframework.util ResourceUtils URL_PROTOCOL_WSJAR.

Prototype

String URL_PROTOCOL_WSJAR

To view the source code for org.springframework.util ResourceUtils URL_PROTOCOL_WSJAR.

Click Source Link

Document

URL protocol for an entry from a WebSphere jar file: "wsjar".

Usage

From source file:org.springframework.extensions.webscripts.ClassPathStore.java

/**
 * Determine whether the given URL points to a resource in a jar file,
 * that is, has protocol "jar", "zip", "vfszip", "wsjar" or "code-source".
 * <p>"zip" and "wsjar" and "vfszip" are used by BEA WebLogic Server and IBM WebSphere
 * and JBoss, 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.
 * /*ww  w  .  ja v a  2  s. c  om*/
 * @param url the URL to check
 * 
 * @return whether the URL has been identified as a JAR URL
 */
protected static boolean isJarURL(final URL url) {
    final String protocol = url.getProtocol();
    return (ResourceUtils.URL_PROTOCOL_JAR.equals(protocol)
            || ResourceUtils.URL_PROTOCOL_VFSZIP.equals(protocol)
            || ResourceUtils.URL_PROTOCOL_ZIP.equals(protocol)
            || ResourceUtils.URL_PROTOCOL_VFS.equals(protocol)
            || ResourceUtils.URL_PROTOCOL_WSJAR.equals(protocol)
            || (ResourceUtils.URL_PROTOCOL_CODE_SOURCE.equals(protocol)
                    && url.getPath().contains(ResourceUtils.JAR_URL_SEPARATOR)));
}