code: function isUrl(url, error) {
              if (!Assertions.urlPattern.test(url)) {
                  if (error) {
                      throw new Error("Given url is not valid ! URL :" + url);
                  }
                  return false;
              }
              return true;
          }
docs: Checks if the string is a valid URL.
  @param {String} url string to check.
  @param {boolean} error defines the return type of method. If it is true it will throw in case of error , else it will return false.
  @returns {boolean} "true": is url , "false": is not url.
  @throws exception if error is true and url provided is not valid.