private void loadJars()

in old/dekaf-core/src/main/java/org/jetbrains/dekaf/Dekaf.java [107:141]


  private void loadJars() {
    final ArrayList<URL> jarUrlList = new ArrayList<URL>(myJarNamesToLoad.size());

    // process names
    for (String jarName : myJarNamesToLoad) {
      File jarFile = new File(jarName);
      if (!jarFile.exists()) {
        error("Jar file to load doesn't exist: %s", jarFile.getPath());
        continue;
      }
      if (!jarFile.isFile()) {
        error("Jar file to load is not a file: %s", jarFile.getPath());
        continue;
      }

      try {
        jarUrlList.add(jarFile.toURI().toURL());
      }
      catch (MalformedURLException e) {
        error("Malformed jar name for jar %s (Exception: %s)", jarName, e.getMessage());
      }
    }

    int n = jarUrlList.size();
    if (n == 0) return;
    final URL[] urls = jarUrlList.toArray(new URL[n]);

    // load jars
    try {
      myDriversClassLoader = new URLClassLoader(urls, Dekaf.class.getClassLoader());
    }
    catch (Exception e) {
      error("Failed to load jars. Exception %s with message %s", e.getClass().getSimpleName(), e.getMessage());
    }
  }