获取一个url的前缀表示，用于快速定位URL模式
规则为：
协议+域名（去掉.)+端口（可选）

@param url
@return
172958
private String urlPrefix(URL url) {
        StringBuilder result = new StringBuilder();
        result.append(url.getProtocol());
        String[] splits = StringUtils.split(url.getHost(), '.');
        if (splits.length > 0) {
            for (String split : splits) {
                result.append(split);
            }
        }
        if (url.getPort() > -1) {
            result.append(Integer.toString(url.getPort()));
        }
        return result.toString();
    }
643612
public static boolean showDocument(URL url) {
        return showDocumentViaDesktop(url)
            || showDocumentViaExec(url)
            || JavaWebStart.showViaWebStart(url);
    }
471333
private static String getProtocol(URL url) {
	String p = url.getProtocol().toLowerCase();
	if (p.indexOf('/') == -1) return p;
	if (p.indexOf("https") != -1) return "https";
	if (p.indexOf("http") != -1) return "http";
	return p;
    }
308129
private HttpGet prepareGet(final String url) {
    final HttpGet httpGet = new HttpGet(this.instanceUrl + url);
    for (final Header header : this.headers) {
      httpGet.addHeader(header);
    }
    return httpGet;
  }
451710
public static String getExtension(String url) {
        url = TextUtils.isEmpty(url) ? "" : url.toLowerCase();
        String extension = MimeTypeMap.getFileExtensionFromUrl(url);
        return TextUtils.isEmpty(extension) ? "" : extension;
    }
1180807
protected BaseResponse executeGet(String url) {
        BaseResponse response;
        BeanUtil.requireNonNull(url, "url is null");
        //需要传token
        String getUrl = url.replace("#", config.getAccessToken());
        response = NetWorkCenter.get(getUrl);
        return response;
    }
191201
static String domainOf(String url) {
    int start = -1;
    if (url.startsWith("//")) {
      start = 2;
    } else {
      start = url.indexOf("://");
      if (start >= 0) { start += 3; }
    }
    if (start < 0) { return null; }
    for (int i = 0; i < start - 3; ++i) {
      switch (url.charAt(i)) {
      case '/': case '?': case '#': return null;
      default: break;
      }
    }
    int end = url.length();
    for (int i = start; i < end; ++i) {
      switch (url.charAt(i)) {
      case '/': case '?': case '#': end = i; break;
      default: break;
      }
    }
    if (start < end) {
      return url.substring(start, end);
    } else {
      return null;
    }
  }
779861
@Sensitive
    protected String removeHostNameFromURL(@Sensitive String url) {
        try {
            int doubleSlash = url.indexOf("//");
            int firstSingleSlash = url.indexOf("/", doubleSlash + 2);
            URL originalURL = new URL(url);
            StringBuffer workURL = new StringBuffer();
            workURL.append(originalURL.getProtocol());
            workURL.append("://");
            int port = originalURL.getPort();
            if (port != -1) {
                workURL.append(":");
                workURL.append(port);
            }
            url = workURL.append(url.substring(firstSingleSlash)).toString();
        } catch (java.net.MalformedURLException e) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "removeHostNameFromURL", new Object[] { e });
            }
        }
        return url;
    }
17635
public static String urlToString(URL url) {
        return Checker.isNull(url) ? "" : url.toString().replaceAll("file:" + (Checker.isWindows() ? "/?" : ""), "");
    }
747732
public static Properties load(URL url) throws IOException {
        InputStream fis = null;
        try {
            Properties props = new Properties();
            fis = url.openStream();
            props.load(fis);
            return props;
        } finally {
            IOUtils.closeQuietly(fis);
        }
    }
354461
public RequestDispatcher getRequestDispatcher(String url)
    {
        if (url == null)
            return null;

        if (!url.startsWith("/"))
        {
            String relTo=URI.addPaths(_servletPath,_pathInfo);
            int slash=relTo.lastIndexOf("/");
            if (slash>1)
                relTo=relTo.substring(0,slash+1);
            else
                relTo="/";
            url=URI.addPaths(relTo,url);
        }
    
        return _servletHandler.getServletContext().getRequestDispatcher(url);
    }
383385
protected static String cleanupUrl(final String url) {
        if (url == null) {
            return null;
        }
        val jsessionPosition = url.indexOf(";jsession");
        if (jsessionPosition == -1) {
            return url;
        }
        val questionMarkPosition = url.indexOf('?');
        if (questionMarkPosition < jsessionPosition) {
            return url.substring(0, url.indexOf(";jsession"));
        }
        return url.substring(0, jsessionPosition) + url.substring(questionMarkPosition);
    }
556091
public static boolean isHttp(String url) {
		if (url.length() < 7 || !url.startsWith("http")) {
			return false;
		}
		int i = 4; // "http"
		if (url.charAt(i) == 's') {
			i++;
		}
		return url.startsWith("://", i);
	}
911993
public static boolean validateUrl(String url) {
        String[] schemes = {"https"};
        UrlValidator urlValidator = new UrlValidator(schemes);
        return urlValidator.isValid(url);
    }
436095
protected String normalizeUrl(String url) {
    try {
      URL requestURL = new URL(url);
      StringBuilder normalized = new StringBuilder(requestURL.getProtocol().toLowerCase()).append("://").append(requestURL.getHost().toLowerCase());
      if ((requestURL.getPort() >= 0) && (requestURL.getPort() != requestURL.getDefaultPort())) {
        normalized.append(":").append(requestURL.getPort());
      }
      normalized.append(requestURL.getPath());
      return normalized.toString();
    }
    catch (MalformedURLException e) {
      throw new IllegalStateException("Illegal URL for calculating the OAuth signature.", e);
    }
  }
399084
public static Response delete(String url) throws HttpException {

		return delete(url, null, null, DEFAULT_CONNECT_TIMEOUT, DEFAULT_READ_TIMEOUT);
	}
660381
public static Condition url(final String url) {
        return new Condition(input -> input.getUrl().equals(url));
    }