code: public static URL asUrlOrResource(String s) {
          if (Strings.isNullOrEmpty(s)) {
              return null;
          }
  
          try {
              return new URL(s);
          } catch (MalformedURLException e) {
              //If its not a valid URL try to treat it as a local resource.
              return findConfigResource(s);
          }
      }
docs: Convert a string to a URL and fallback to classpath resource, if not convertible.
  
  @param s
  The string to convert.
  
  @return The URL.