code: public static String concat(String mainUrl, String relativeUrl) {
          if (StringUtils.isEmpty(mainUrl)) {
              return relativeUrl;
          } else if (StringUtils.isEmpty(relativeUrl)) {
              return mainUrl;
          } else {
              StringBuilder joinedUrl = new StringBuilder(mainUrl);
  
              if (mainUrl.endsWith("/") && relativeUrl.startsWith("/")) {
                  relativeUrl = StringUtils.stripStart(relativeUrl, "/");
              } else if (!mainUrl.endsWith("/") && !relativeUrl.startsWith("/")) {
                  joinedUrl.append("/");
              }
  
              joinedUrl.append(relativeUrl);
  
              return joinedUrl.toString();
          }
      }
docs: Concats two urls, adding any "/" needed between them.
  
  @param mainUrl      the main url
  @param relativeUrl  the relative url
  
  @return mainPath + relativeUrl