Returns the URL without the port and the query string part.

@return the OAuth-sanitized URL
778473
public String getSanitizedUrl() {
        if (url.startsWith("http://") && (url.endsWith(":80") || url.contains(":80/"))) {
            return url.replaceAll("\\?.*", "").replaceAll(":80", "");
        } else if (url.startsWith("https://") && (url.endsWith(":443") || url.contains(":443/"))) {
            return url.replaceAll("\\?.*", "").replaceAll(":443", "");
        } else {
            return url.replaceAll("\\?.*", "");
        }
    }
271082
public String getRequestURL()
    {
    	HttpServletRequest httpReq = getRequest();
    	if (httpReq==null)
    		return null;
    	else
    		return httpReq.getRequestURL().toString();
    }
189870
private String hostAndPort() {
        int start = url.indexOf("://") + 3;
        int end = url.indexOf("/", start);
        return url.substring(start, end);
    }
147652
@RestrictTo(LIBRARY)
  public String url() {
    String url;
    if (iconUrl() != null) {
      return String.format(
        Locale.US, "url-%s(%f,%f)", iconUrl(), lnglat().longitude(), lnglat().latitude());
    }

    if (color() != null && !TextUtils.isEmpty(label())) {
      url = String.format(Locale.US, "%s-%s+%s", name(), label(), color());
    } else if (!TextUtils.isEmpty(label())) {
      url = String.format(Locale.US, "%s-%s", name(), label());
    } else if (color() != null) {
      url = String.format(Locale.US, "%s+%s", name(), color());
    } else {
      url = name();
    }

    return String.format(Locale.US, "%s(%f,%f)", url, lnglat().longitude(), lnglat().latitude());
  }
443269
public SafeUrl toSafeUrl() {
    Preconditions.checkState(
        getContentKind() == ContentKind.URI,
        "toSafeUrl() only valid for SanitizedContent of kind URI, is: %s",
        getContentKind());
    return UncheckedConversions.safeUrlFromStringKnownToSatisfyTypeContract(getContent());
  }
922132
@Override
    public StringBuffer getRequestURL() {

        StringBuffer sb = new StringBuffer(getScheme());
        sb.append("://");
        // Note: following code required if IPv6 IP host does not contain brackets
        // String host = getTargetHost();
        // if (-1 != host.indexOf(":")) {
        // // wrap brackets around the IPv6 IP address
        // host = "[" + host + "]";
        // }
        // sb.append(host);
        sb.append(getTargetHost());
        sb.append(':');
        sb.append(getTargetPort());
        sb.append(getRequestURI());
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getRequestURL() returning " + sb.toString());
        }
        return sb;
    }
516113
public String getAuthority(HttpUrl url) {
        String scheme = url.scheme();
        String host = url.host();
        int port = url.port();
        StringBuilder builder = new StringBuilder();
        if (scheme != null) {
            builder.append(scheme).append("://");
        }
        builder.append(host);
        if (port >= 0) {
            builder.append(':').append(port);
        }
        return builder.toString();
    }
823691
public static String urlToHost(String url) {
		String lcUrl = url.toLowerCase();
		if(lcUrl.startsWith(DNS_SCHEME)) {
			return lcUrl.substring(DNS_SCHEME.length());
		}
		for(String scheme : ALL_SCHEMES) {
			if(lcUrl.startsWith(scheme)) {
				int authorityIdx = scheme.length();

				Matcher m = 
					HOST_REGEX_SIMPLE.matcher(lcUrl.substring(authorityIdx));
				if(m.find()) {
					return m.group(1);
				}
			}
		}
		return url;
	}
1329907
@Override
	public String getUrl() {
		StringBuilder sb = new StringBuilder();
		int hostId = random.nextInt(URL_HOSTS.length);
		String host = String.format(URL_HOSTS[hostId], getWords(1));
		sb.append(host);
		return sb.toString();
	}
1050081
public String buildRequestUrl() {
    StringBuilder sb = new StringBuilder();
    sb.append(buildServletPath());
    if (null != pathInfo) {
      sb.append(pathInfo);
    }
    if (null != queryString) {
      sb.append('?').append(queryString);
    }
    return sb.toString();
  }
603731
public String getUrl(){
		final StringBuilder sb = new StringBuilder();
		sb.append("http://");
		sb.append(getHttpConfiguration().getBindHost().get());
		sb.append(":");
		sb.append(getHttpConfiguration().getPort());
		
		return sb.toString();
	}
352530
public String getUrl() {
		if (StringUtils.isBlank(url) && !StringUtils.isBlank(name)) {
			this.url = AWSQueueUtils.createQueue(name);
		}
		return url;
	}
343770
public String getOpenBrowserUrl() {
        final String customUrl = getCustomBrowserUrl();
        final String deployUrl = getDeployUrl();
        if (customUrl == null) {
            return deployUrl;
        } else if (customUrl.startsWith("http://")) {
            return customUrl;
        } else if (customUrl.startsWith("/")) {
            return buildUrl(getPort(), customUrl);
        } else {
            return deployUrl + customUrl;
        }
    }
624366
public function getUrl()
    {
        if(!isset($this->_url))
        {
            //Scheme
            $scheme = $this->getScheme();

            //Host
            $host   = $this->getHost();

            /*
             * Since we are assigning the URI from the server variables, we first need to determine if we
             * are running on apache or IIS.  If PHP_SELF and REQUEST_URI are present, we will assume we
             * are running on apache.
             */
            if (!empty ($_SERVER['PHP_SELF']) && !empty ($_SERVER['REQUEST_URI']))
            {
                //Prepend the protocol, and the http host to the URI string.
                $url = $scheme.'://'.$host . $_SERVER['REQUEST_URI'];
            }
            else
            {
                /*
                 * Since we do not have REQUEST_URI to work with, we will assume we are running on IIS
                 * and will therefore need to work some magic with the SCRIPT_NAME and QUERY_STRING
                 * environment variables.
                 */

                // IIS uses the SCRIPT_NAME variable instead of a REQUEST_URI variable
                $url = $scheme.'://'.$host . $_SERVER['SCRIPT_NAME'];

                // If the query string exists append it to the URI string
                if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
                    $url .= '?' . $_SERVER['QUERY_STRING'];
                }
            }

            // Sanitize the url since we can't trust the server var
            $url = $this->getObject('lib:filter.url')->sanitize($url);

            // Create the URI object
            $this->_url = $this->getObject('lib:http.url', array('url' => $url));

            //Set the url port
            $port = $this->getPort();

            if (($this->_url->scheme == 'http' && $port != 80) || ($this->_url->scheme == 'https' && $port != 443)) {
                $this->_url->port = $port;
            }

            //Set the user
            if($this->_headers->has('PHP_AUTH_USER'))
            {
                $this->_url->user = $this->_headers->get('PHP_AUTH_USER');

                if($this->_headers->has('PHP_AUTH_PW')) {
                    $this->_url->pass = $this->_headers->get('PHP_AUTH_PASS');
                }
            }
        }

        return $this->_url;
    }
75820
public String buildUrl() {
    StringBuilder sb = new StringBuilder();
    boolean includePort = true;
    if (null != scheme) {
      sb.append(scheme).append("://");
      includePort = (port != (scheme.equals("http") ? 80 : 443));
    }
    if (null != serverName) {
      sb.append(serverName);
      if (includePort && port > 0) {
        sb.append(':').append(port);
      }
    }
    if (!Objects.equals(contextPath, "/")) {
      sb.append(contextPath);
    }
    sb.append(buildRequestUrl());
    return sb.toString();
  }
1255538
public String[] getUrl() {
        String[] valueDestination = new String[ url.size() ];
        this.url.getValue(valueDestination);
        return valueDestination;
    }
399582
private static Optional<String> sanitizeRedirectUrl(@Nullable String url) {
    if (Strings.isNullOrEmpty(url)) {
      return empty();
    }
    if (url.startsWith("//") || url.startsWith("/\\")) {
      return empty();
    }
    if (!url.startsWith("/")) {
      return empty();
    }
    return Optional.of(url);
  }