code: public static URL generateUrl(final String url) throws OMDBException {
          try {
              return new URL(url);
          } catch (MalformedURLException ex) {
              throw new OMDBException(ApiExceptionType.INVALID_URL, "Failed to create URL", url, ex);
          }
      }
docs: Generate a URL object from a String URL
  
  @param url
  @return
  @throws OMDBException