/** * <p> * Creates and returns the appropriate URL resolver for the given {@link URL} * protocol. * </p> * * @param protocol * The protocol of the location url to scan. * @return The url resolver for this protocol. */ private static UrlResolver createUrlResolver(String protocol) { // Websphere if (protocol.startsWith("wsjar")) { LOG.trace("Selected URL resolver: {}", WebSphereUrlResolver.class.getSimpleName()); return new WebSphereUrlResolver(); } // JBoss 5+ / WildFly if (protocol.startsWith("vfs") || protocol.startsWith("vfszip")) { if (LibraryDetector.isJBossVFS2Available()) { LOG.trace("Selected URL resolver: {}", JBossVFS2UrlResolver.class.getSimpleName()); return new JBossVFS2UrlResolver(); } if (LibraryDetector.isJBossVFS3Available()) { LOG.trace("Selected URL resolver: {}", JBossVFS3UrlResolver.class.getSimpleName()); return new JBossVFS3UrlResolver(); } } LOG.trace("Selected URL resolver: {}", StandardUrlResolver.class.getSimpleName()); return new StandardUrlResolver(); }
/** * <p> * Creates and returns the appropriate URL resolver for the given {@link URL} * protocol. * </p> * * @param protocol * The protocol of the location url to scan. * @return The url resolver for this protocol. */ private static UrlResolver createUrlResolver(String protocol) { // Websphere if (protocol.startsWith("wsjar")) { LOG.trace("Selected URL resolver: {}", WebSphereUrlResolver.class.getSimpleName()); return new WebSphereUrlResolver(); } // JBoss 5+ / WildFly if (protocol.startsWith("vfs") || protocol.startsWith("vfszip")) { if (LibraryDetector.isJBossVFS2Available()) { LOG.trace("Selected URL resolver: {}", JBossVFS2UrlResolver.class.getSimpleName()); return new JBossVFS2UrlResolver(); } if (LibraryDetector.isJBossVFS3Available()) { LOG.trace("Selected URL resolver: {}", JBossVFS3UrlResolver.class.getSimpleName()); return new JBossVFS3UrlResolver(); } } LOG.trace("Selected URL resolver: {}", StandardUrlResolver.class.getSimpleName()); return new StandardUrlResolver(); }