src/main/java/io/avaje/classpath/scanner/internal/scanner/classpath/ClassPathScanner.java
private ClassPathLocationScanner createLocationScanner(String protocol) {
    final ClassPathLocationScanner scanner = locationScannerCache.get(protocol);
    if (scanner != null) {
      return scanner;
    }

    if ("file".equals(protocol)) {
      FileSystemClassPathLocationScanner locationScanner = new FileSystemClassPathLocationScanner();
      locationScannerCache.put(protocol, locationScanner);
      resourceNameCache.put(locationScanner, new HashMap<>());
      return locationScanner;
    }

    //zip - WebLogic, wsjar - WebSphere
    if ("jar".equals(protocol) || "zip".equals(protocol) || "wsjar".equals(protocol)) {
      JarFileClassPathLocationScanner locationScanner = new JarFileClassPathLocationScanner();
      locationScannerCache.put(protocol, locationScanner);
      resourceNameCache.put(locationScanner, new HashMap<>());
      return locationScanner;
    }

    EnvironmentDetection featureDetector = new EnvironmentDetection(classLoader);
    if (featureDetector.isJBossVFSv3() && "vfs".equals(protocol)) {
      JBossVFSv3ClassPathLocationScanner locationScanner = new JBossVFSv3ClassPathLocationScanner();
      locationScannerCache.put(protocol, locationScanner);
      resourceNameCache.put(locationScanner, new HashMap<>());
      return locationScanner;
    }
    // bundle - Felix, bundleresource - Equinox
    if (featureDetector.isOsgi() && ("bundle".equals(protocol) || "bundleresource".equals(protocol)) ) {
      OsgiClassPathLocationScanner locationScanner = new OsgiClassPathLocationScanner();
      locationScannerCache.put(protocol, locationScanner);
      resourceNameCache.put(locationScanner, new HashMap<>());
      return locationScanner;
    }
    return null;
  }
/**
   * Creates an appropriate location scanner for this url protocol.
   *
   * @param protocol The protocol of the location url to scan.
   * @return The location scanner or {@code null} if it could not be created.
   */
Creates an appropriate location scanner for this url protocol.
@param protocol The protocol of the location url to scan.
@return The location scanner or  null if it could not be created.
Creates an appropriate location scanner for this url protocol . @param protocol The protocol of the location url to scan . @return The location scanner or null if it could not be created .
private ClassPathLocationScanner createLocationScanner(String protocol) {
    final ClassPathLocationScanner scanner = locationScannerCache.get(protocol);
    if (scanner != null) {
      return scanner;
    }
    if ("file".equals(protocol)) {
      FileSystemClassPathLocationScanner locationScanner = new FileSystemClassPathLocationScanner();
      locationScannerCache.put(protocol, locationScanner);
      resourceNameCache.put(locationScanner, new HashMap<>());
      return locationScanner;
    }
    if ("jar".equals(protocol) || "zip".equals(protocol) || "wsjar".equals(protocol)) {
      JarFileClassPathLocationScanner locationScanner = new JarFileClassPathLocationScanner();
      locationScannerCache.put(protocol, locationScanner);
      resourceNameCache.put(locationScanner, new HashMap<>());
      return locationScanner;
    }
    EnvironmentDetection featureDetector = new EnvironmentDetection(classLoader);
    if (featureDetector.isJBossVFSv3() && "vfs".equals(protocol)) {
      JBossVFSv3ClassPathLocationScanner locationScanner = new JBossVFSv3ClassPathLocationScanner();
      locationScannerCache.put(protocol, locationScanner);
      resourceNameCache.put(locationScanner, new HashMap<>());
      return locationScanner;
    }
    if (featureDetector.isOsgi() && ("bundle".equals(protocol) || "bundleresource".equals(protocol)) ) {
      OsgiClassPathLocationScanner locationScanner = new OsgiClassPathLocationScanner();
      locationScannerCache.put(protocol, locationScanner);
      resourceNameCache.put(locationScanner, new HashMap<>());
      return locationScanner;
    }
    return null;
  }
private ClassPathLocationScanner createLocationScanner ( String protocol ) { final ClassPathLocationScanner scanner = locationScannerCache . get ( protocol ) ; if ( scanner != null ) { return scanner ; } if ( "file" . equals ( protocol ) ) { FileSystemClassPathLocationScanner locationScanner = new FileSystemClassPathLocationScanner ( ) ; locationScannerCache . put ( protocol , locationScanner ) ; resourceNameCache . put ( locationScanner , new HashMap < > ( ) ) ; return locationScanner ; } if ( "jar" . equals ( protocol ) || "zip" . equals ( protocol ) || "wsjar" . equals ( protocol ) ) { JarFileClassPathLocationScanner locationScanner = new JarFileClassPathLocationScanner ( ) ; locationScannerCache . put ( protocol , locationScanner ) ; resourceNameCache . put ( locationScanner , new HashMap < > ( ) ) ; return locationScanner ; } EnvironmentDetection featureDetector = new EnvironmentDetection ( classLoader ) ; if ( featureDetector . isJBossVFSv3 ( ) && "vfs" . equals ( protocol ) ) { JBossVFSv3ClassPathLocationScanner locationScanner = new JBossVFSv3ClassPathLocationScanner ( ) ; locationScannerCache . put ( protocol , locationScanner ) ; resourceNameCache . put ( locationScanner , new HashMap < > ( ) ) ; return locationScanner ; } if ( featureDetector . isOsgi ( ) && ( "bundle" . equals ( protocol ) || "bundleresource" . equals ( protocol ) ) ) { OsgiClassPathLocationScanner locationScanner = new OsgiClassPathLocationScanner ( ) ; locationScannerCache . put ( protocol , locationScanner ) ; resourceNameCache . put ( locationScanner , new HashMap < > ( ) ) ; return locationScanner ; } return null ; }
Creates an appropriate location scanner for this url protocol.
Creates an appropriate location scanner for this url protocol .
//zip - WebLogic, wsjar - WebSphere // bundle - Felix, bundleresource - Equinox