Gets whether or not the specified URL matches this WildcardURL
@param sUrl The URL to check.
@return <code>True</code> if the protocol, domain, directory and path match the specified URL, otherwise <code>false</code>
437514
public boolean matches(String sUrl) {
        URL url = null;
        try {
            url = new URL(sUrl);
        } catch (MalformedURLException e) {
            //ignore, just return false
            return false;
        }
        return matches(url);
    }
597893
public boolean matches(String uri) {
		if (uri == null) {
			return false;
		}
		Matcher matcher = this.matchPattern.matcher(uri);
		return matcher.matches();
	}
1169310
public function isCurrentUrl($sURL)
    {
        // Missing protocol, cannot proceed, assuming true.
        if (!$sURL || (strpos($sURL, "http") !== 0)) {
            return true;
        }

        $sServerHost = $this->getServerVar('HTTP_HOST');
        $blIsCurrentUrl = $this->_isCurrentUrl($sURL, $sServerHost);
        if (!$blIsCurrentUrl) {
            $sServerHost = $this->getServerVar('HTTP_X_FORWARDED_HOST');
            if ($sServerHost) {
                $blIsCurrentUrl = $this->_isCurrentUrl($sURL, $sServerHost);
            }
        }

        return $blIsCurrentUrl;
    }
765434
public final static boolean isValidURL(String url) {
        if (url == null) {
            return false;
        } else {
            return Patterns.WEB_URL.matcher(url).matches();
        }
    }
1266808
public static boolean isJarFileURL(URL url) {
        return (URL_PROTOCOL_FILE.equals(url.getProtocol()) &&
                url.getPath().toLowerCase().endsWith(JAR_FILE_EXTENSION));
    }
320404
private boolean checkUrl(String url) {
        try {
            URI uri = new URI(url);
            return uri.isAbsolute();
        } catch (URISyntaxException e) {
            return false;
        }
    }
1103150
public static boolean containsURL(final URL[] urls, final URL url) {
        checkNotNull("urls", urls);
        checkNotNull("url", url);
        for (int i = 0; i < urls.length; i++) {
            final URL element = urls[i];
            final String elementStr = element.toExternalForm();
            final String urlStr = url.toExternalForm();
            if (elementStr.equals(urlStr)) {
                return true;
            }
        }
        return false;
    }
53986
private boolean wildcardMatch(Set<String> pValues, String pValue) {
        for (String pattern : pValues) {
            if (pattern.contains("*") && pValue.matches(pattern.replaceAll("\\*",".*"))) {
                return true;
            }
        }
        return false;
    }
633107
protected boolean isMatch(IPListConfig config, String remoteAddr) {
        if (config.getIpList().contains(remoteAddr)) {
            return true;
        }
        try {
            String [] remoteAddrSplit = remoteAddr.split("\\."); //$NON-NLS-1$
            for (String ip : config.getIpList()) {
                String [] ipSplit = ip.split("\\."); //$NON-NLS-1$
                if (remoteAddrSplit.length == ipSplit.length) {
                    int numParts = ipSplit.length;
                    boolean matches = true;
                    for (int idx = 0; idx < numParts; idx++) {
                        if (ipSplit[idx].equals("*") || ipSplit[idx].equals(remoteAddrSplit[idx])) { //$NON-NLS-1$
                            // This component matches!
                        } else {
                            matches = false;
                            break;
                        }
                    }
                    if (matches) {
                        return true;
                    }
                }
            }
        } catch (Throwable t) {
            // eat it
        }
        return false;
    }
38827
public static boolean isAbsoluteUrl(String location) {
        if (location != null && location.length() > 0 && location.contains(":")) {
            try {
                URI uri = new URI(location);
                return uri.getScheme() != null;
            } catch (URISyntaxException e) {
                // ignore invalid locations and consider not absolute
            }
        }
        return false;
    }
336183
function _getHostByPeerUrl( sUrl )
{
	let arrMatches;

	//
	//	this regex will match wss://xxx and ws://xxx
	//
	arrMatches = sUrl.match( /^wss?:\/\/(.*)$/i );
	if ( Array.isArray( arrMatches ) && arrMatches.length >= 1 )
	{
		sUrl = arrMatches[ 1 ];
	}

	//	...
	arrMatches	= sUrl.match( /^(.*?)[:\/]/ );
	return ( Array.isArray( arrMatches ) && arrMatches.length >= 1 ) ? arrMatches[ 1 ] : sUrl;
}
111678
protected static boolean isDir(URL url)
    {
        String file = url.getFile();
        return file != null && file.endsWith("/");
    }
252044
protected boolean match(final String path) {

        final String methodName = "match";

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName, this, path, ignoreCase, wildcard);
        }

        if (this.matcher == null) {
            if (ignoreCase) {
                if (pattern.equalsIgnoreCase(path)) {
                    return true;
                }
                if (wildcard && path.toLowerCase().startsWith(pattern)) {
                    return true;
                }
            } else {
                if (pattern.equals(path)) {
                    return true;
                }
                if (wildcard && path.startsWith(pattern)) {
                    return true;
                }
            }
        } else {
            return this.matcher.matcher(path).matches();
        }

        return false;
    }
272857
public boolean matches(String path, MatchingStrategy matchingStrategy) {
    return path!=null && matchingStrategy.matches(clause, path);
  }
474010
private boolean isURLAbsolute(String url) {
        for (String protocol : PROTOCOLS) {
            if (url.startsWith(protocol)) {
                return true;
            }
        }

        return false;
    }
816330
public static boolean isXForwardedAllowed(String remoteAddr) {
        return isXForwardedAllowed() && (S.eq("all", xForwardedAllowed) || xForwardedAllowed.contains(remoteAddr));
    }
1373217
function compareUrl(urlA, urlB) {
  var same = false;
  
  // Remove url fragments
  if( urlA.indexOf('#') > -1)
      urlA = urlA.split('#')[0];
 
  if( urlB.indexOf('#') > -1)
      urlB = urlB.split('#')[0];
  
  if(urlA != '' || urlB != ''){
      //Remove common subdomain
      urlA = urlA.toLowerCase().replace('www.','');
      urlB = urlB.toLowerCase().replace('www.','');
      
      // Make sure anything ends with / 
      if( endsWith(urlA,'/') == false)
          urlA = urlA + '/';
          
      if( endsWith(urlB,'/') == false)
          urlB = urlB + '/';    
          
      // Look for full match
      if(urlA.toLowerCase() == urlB.toLowerCase())
          same = true;
     
  }
  return same;
}