code: public static URL toAbsolute(URL baseURL, String relative) {
          try {
              return new URL(baseURL, relative);
          } 
          catch (MalformedURLException ex) {
              throw new RuntimeException(ex);
          }
      }
docs: Converts a relative URL to absolute URL.
  
  @param baseURL
  @param relative
  @return