code: public static URL url(final String url) {
          if (url == null) {
              return null;
          }
          try {
              if (url.startsWith("classpath:")) {
                  return new URL(null, url, new ClasspathURLStreamHandler());
              }
              return new URL(url);
          } catch (final MalformedURLException ex) {
              throw new IllegalArgumentException("Invalid URL: " + url, ex);
          }
      }
docs: Returns a given string as URL and supports "classpath:" scheme. A <code>null</code> argument returns <code>null</code>.
  
  @param url
  String to convert into an URL or <code>null</code>.
  
  @return URL or <code>null</code>