Add a simple url generator
Example: networkProducer.url(baseProducer.trueOrFalse())

@param isHttps is https or not
@return A faked url.
168727
public String url(boolean isHttps) {
		String mergedIP = ipAddress().replaceAll("\\.", "");
		char[] domainChars = mergedIP.toCharArray();
		for (int i = 0; i < domainChars.length; i++) {
			char c = domainChars[i];
			domainChars[i] = (char) (c + 97);
		}

		String domain = String.valueOf(domainChars);
		if (isHttps) {
			return "https://" + domain + ".com";
		} else {
			return "http://" + domain + ".com";
		}
	}
874215
protected boolean isValidURL(String inputString) {

        boolean isValid = false;
        try {
            if (inputString != null) {
                URL tempURL = new URL(inputString);
                isValid = (tempURL.getProtocol() != null);
            }
        } catch (MalformedURLException mue) {
            // ignore because it is not harmful
        }
        return isValid;
    }
215879
public static URL generateUrl(final String url) throws OMDBException {
        try {
            return new URL(url);
        } catch (MalformedURLException ex) {
            throw new OMDBException(ApiExceptionType.INVALID_URL, "Failed to create URL", url, ex);
        }
    }
1112648
def build_url_base(host, port, is_https):
    
    base = "http"
    if is_https:
        base += 's'

    base += "://"
    base += host

    if port:
        base += ":"
        base += str(port)

    return base
595048
function(urls) {
		var self = this;
		if (typeof urls === 'string') {
			urls = [ urls ];
		}
		$.each(urls, function(i, url) {
			url = self.convAbsUrl(url).replace(/^https?:/i, '');
			if (! $("head > link[href='+url+']").length) {
				$('head').append('<link rel="stylesheet" type="text/css" href="' + url + '" />');
			}
		});
		return this;
	}
1265101
private InputSource createInputSourceFromUrl(URL xmlInputUrl) {
        String stringUrl = xmlInputUrl.toString();
        return new InputSource(stringUrl);
    }
1221928
public URL constructURL() throws InvalidRequestException {	
 
        String stringUri = url;

        try {
            URI uri = new URI(stringUri);
            return uri.toURL();
        } catch (final URISyntaxException e) {
            throw new InvalidRequestException("Bad URI: " + stringUri, e);
        } catch (final MalformedURLException e) {
            throw new InvalidRequestException("Bad URL: " + stringUri, e);
        }
    }
232101
public HttpUrl url() {
    HttpUrl.Builder urlBuilder = HttpUrl.parse(baseUrl()).newBuilder()
      .addPathSegment("styles")
      .addPathSegment("v1")
      .addPathSegment(user())
      .addPathSegment(styleId())
      .addPathSegment("static")
      .addQueryParameter("access_token", accessToken());

    List<String> annotations = new ArrayList<>();
    if (staticMarkerAnnotations() != null) {
      List<String> markerStrings = new ArrayList<>(staticMarkerAnnotations().size());
      for (StaticMarkerAnnotation marker : staticMarkerAnnotations()) {
        markerStrings.add(marker.url());
      }
      annotations.addAll(markerStrings);
    }

    if (staticPolylineAnnotations() != null) {
      String[] polylineStringArray = new String[staticPolylineAnnotations().size()];
      for (StaticPolylineAnnotation polyline : staticPolylineAnnotations()) {
        polylineStringArray[staticPolylineAnnotations().indexOf(polyline)] = polyline.url();
      }
      annotations.addAll(Arrays.asList(polylineStringArray));
    }

    if (geoJson() != null) {
      annotations.add(String.format(Locale.US, "geojson(%s)", geoJson().toJson()));
    }

    if (!annotations.isEmpty()) {
      urlBuilder.addPathSegment(TextUtils.join(",", annotations.toArray()));
    }

    urlBuilder.addPathSegment(cameraAuto() ? CAMERA_AUTO
      : generateLocationPathSegment());

    if (beforeLayer() != null) {
      urlBuilder.addQueryParameter(BEFORE_LAYER, beforeLayer());
    }
    if (!attribution()) {
      urlBuilder.addQueryParameter("attribution", "false");
    }
    if (!logo()) {
      urlBuilder.addQueryParameter("logo", "false");
    }

    // Has to be last segment in URL
    urlBuilder.addPathSegment(generateSizePathSegment());
    return urlBuilder.build();

  }
911993
public static boolean validateUrl(String url) {
        String[] schemes = {"https"};
        UrlValidator urlValidator = new UrlValidator(schemes);
        return urlValidator.isValid(url);
    }
316298
public static URL buildPostUrl(String host, int port, String path) throws MalformedURLException {
        return buildPostUrl("http", host, port, path);
    }
774079
public I addPage(WebPage webPage) {
        beforeAddPageEvent(webPage);
        urls.put(baseUrl + webPage.constructName(), webPage);
        return getThis();
    }
305296
static public function getUploadUrl($isAbsolute=true)
    {
        $url = static::getCommon('uploadUrl');
        if ($isAbsolute && strpos($url, 'http') !== 0) {
            $baseUrl = static::getRootUrl();
            $url = rtrim($baseUrl, '/') . '/' . trim($url, '/');
        }
        
        return $url;
    }
697174
protected function _constructBaseUrl($servlet, $params = array())
    {
        if (count($params))
        {
            //escape all parameters appropriately for inclusion in the query string
            $escapedParams = array();

            foreach ($params as $key => $value)
            {
                $escapedParams[] = urlencode($key) . '=' . urlencode($value);
            }

            $queryString = $this->_queryDelimiter . implode($this->_queryStringDelimiter, $escapedParams);
        }
        else
        {
            $queryString = '';
        }
        
        if (!$this->_basePath) {
            throw new Exception('Please provide a base path');
        }

        $protocol = 'http://';
        if ($this->_useHttps) {
            $protocol = 'https://';
        }
        return $protocol . $this->_host . ':' . $this->_port . $this->_basePath . $servlet . $queryString;
    }
682849
function isUrl (url) {
  if (!url) return false
  url = url.toString()
  return url.indexOf('http://') === 0 || url.indexOf('https://') === 0
}
1100731
public static boolean isValidUrl(String url) {
        try {
            if (Strings.isNullOrEmpty(url)) {
                return false;
            }
            new URL(url);
            return true;
        } catch (MalformedURLException e) {
            return false;
        }
    }
1125193
function urlFromHttpRequestOptions(options, protocol) {
  var parsedPath = options.path.split('?');
  var pathname = parsedPath.shift();
  var search = parsedPath.join('?');

  var urlOptions = {
    protocol: protocol,
    hostname: options.hostname || options.host,
    auth: options.auth,
    port: options.port,
    pathname: pathname,
    search: search
  };

  return url.format(urlOptions);
}
588317
public static String pingSoapHttpUrl(String soapHttpUrl) {
		soapHttpUrl += "?wsdl";
		try {
			URL url = new URL(soapHttpUrl);
			Object content = url.getContent();
			InputStream is = (InputStream)content;
			String c = MiscUtil.convertStreamToString(is);
			
			boolean isWsdl = c.contains("http://schemas.xmlsoap.org/wsdl");
			
			if (isWsdl) {
				return OK_PREFIX + ": The url " + soapHttpUrl + " responded with a wsdl as expected"; 
			} else {
			    return ERROR_PREFIX + ": The url " + soapHttpUrl + " does not seem to expose a wsdl, unexpected response: " + c; 
				
			}

		} catch (MalformedURLException e) {
		    return ERROR_PREFIX + ": The url " + soapHttpUrl + " did not respon as expected, reason: " + e; 
		} catch (IOException e) {
		    return ERROR_PREFIX + ": The url " + soapHttpUrl + " did not respon as expected, reason: " + e; 
		}   	
	}