code: public static URL getResource(String resource, ClassLoader classLoader) throws IOException {
          URL url = null;
          if (classLoader != null) {
              url = classLoader.getResource(resource);
          }
          if (url == null) {
              url = ClassLoader.getSystemResource(resource);
          }
          if (url == null) {
              throw new IOException("Could not find resource '" + resource + "'");
          }
          return url;
      }
docs: Returns the URL of the resource on the classpath.
  
  @param classLoader the class loader used to load the resource
  @param resource the resource to find
  @return {@code URL} object for reading the resource;
  {@code null} if the resource could not be found
  @throws IOException if the resource cannot be found or read