private List<URL> buildClasspath(List<String> jars) throws IOException {
    List<URL> urls = new ArrayList<>();

    for (String jar : jars) {
      Path jarPath = Paths.get(jar);
      if (Files.isDirectory(jarPath)) {
        try (Stream<Path> stream = Files.list(jarPath)) {
          List<Path> files =
            stream.filter((path) -> Files.isRegularFile(path)).collect(Collectors.toList());

          for (Path file : files) {
            URL url = file.toUri().toURL();
            urls.add(url);
          }
        }
      } else {
        URL url = jarPath.toUri().toURL();
        urls.add(url);
      }
    }

    return urls;
  }
This classloader implementation calls {@link #resolveClass(Class)} method for every loaded
class. It means that some extra validation will take place
<a href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-12.html#jls-12.3"> according to
JLS</a>.
hbase-server/src/main/java/org/apache/hadoop/hbase/tool/coprocessor/CoprocessorValidator.java