code: private static String checkAppURL(String originalAppURL, String newAppURL, String s) {
          if (newAppURL != null && !"".equals(newAppURL)) {
              if (!newAppURL.toLowerCase().startsWith("http") && !newAppURL.toLowerCase().startsWith("file")) {
                  newAppURL = "http://" + newAppURL;
              }
              try {
                  new URL(newAppURL);
                  return newAppURL;
              } catch (MalformedURLException e) {
                  log.error(s + newAppURL + "' is not a valud URL.");
              }
          }
          return originalAppURL;
      }
docs: A helper method to getAppURL, which checks the provided URL, and if it is valid, overrides the initially
  provided one.
  
  @param originalAppURL - the original and currently set app url
  @param newAppURL      - the new app url to check
  @param s              - the location being checked (for reporting)
  @return String: the most valid URL, new if it is valid, original if not