private KernelManager() { // Load Nuun and Reflections classes to force initialization of Vfs url types try { Class.forName(Vfs.class.getCanonicalName()); Class.forName(AbstractClasspathScanner.class.getCanonicalName()); } catch (ClassNotFoundException e) { throw new RuntimeException("Cannot initialize the classpath scanning infrastructure", e); } // Save existing url types savedUrlTypes = Vfs.getDefaultUrlTypes(); // Find all classpath scan handlers and add their Vfs url types List<Vfs.UrlType> urlTypes = new ArrayList<>(); for (ClasspathScanHandler classpathScanHandler : ServiceLoader.load(ClasspathScanHandler.class)) { LOGGER.trace("Detected classpath handler {}", classpathScanHandler.getClass().getCanonicalName()); urlTypes.addAll(classpathScanHandler.urlTypes()); } LOGGER.debug("URL types for scanning: {}", urlTypes); detectedUrlTypes = urlTypes; }
if (!Vfs.getDefaultUrlTypes().contains(getInstance())) { Vfs.addDefaultURLTypes(getInstance());