code: public static String toAbsolute(String base, String relative) {
          String absolute = null;
          base = base.trim();
          relative = relative.trim();
          
          if(relative.isEmpty()) {
              return absolute;
          }
          
          String rel2lowercase = relative.toLowerCase(Locale.ENGLISH);
          
          if(rel2lowercase.startsWith("mailto:") || rel2lowercase.startsWith("javascript:")) {
              return absolute;
          }
          
          try {
              absolute = toAbsolute(new URL(base), relative).toString();
          } 
          catch (MalformedURLException ex) {
              throw new RuntimeException(ex);
          }
          
          return absolute;
      }
docs: Converts a relative URL to absolute URL.
  
  @param base
  @param relative
  @return