Does the URL represent a .rar file
@param url The URL
@return <code>true</code> if .rar file, otherwise <code>false</code>
433609
protected boolean isRarFile(URL url)
   {
      if (url != null && url.toExternalForm().endsWith(".rar") && !url.toExternalForm().startsWith("jar"))
         return true;

      return false;
   }
984144
public static boolean isFileURL(URL url) {
        String protocol = url.getProtocol();
        return (URL_PROTOCOL_FILE.equals(protocol) || protocol.startsWith(URL_PROTOCOL_VFS));
    }
62080
function isLocalURL( aURL ) {

    // check if the URL belongs to an asset on the same domain the application is running on

    if ( aURL.substr( 0, 2 ) === "./" ||
        aURL.indexOf( window.location.protocol + "//" + window.location.host ) === 0 ) {
        return true;
    }

    // check if given URL is a http(s) URL, if so we know it is not local

    let urlRoot = ( aURL.split( "#" )[ 0 ] ).split( "?" )[ 0 ];

    // .html-file in the path name ? strip it

    if ( urlRoot.indexOf( ".html" ) > -1 ) {

        const urlArr    = urlRoot.split( "/" );
        const arrLength = urlArr.length;
        urlRoot = urlRoot.split( urlArr[ arrLength - 1 ]).join( "" );
    }

    if ( urlRoot ) {
        const match = urlRoot.match( /^http[s]?:/ );
        if ( Array.isArray( match ) && match.length > 0 ) {
            return false;
        }
    }

    // at this point we know we're likely dealing with a data URL, which is local

    return true;
}
532532
public static final File URLToFile(URL url) throws MalformedURLException {
	if (!"file".equals(url.getProtocol())) throw new MalformedURLException("URL protocol must be 'file'.");
	return new File(URIToFilename(url.getFile()));
    }
707487
public boolean hasToolPathForUrl(String url) {

        List<String> toolPaths = m_urls.getObjectList(url);
        return ((toolPaths != null) && !toolPaths.isEmpty());
    }
512299
public static boolean isHttpUrl(String s) {
        String lowerCaseSource = s.toLowerCase();
        return lowerCaseSource.startsWith("https:/") || lowerCaseSource.startsWith("http:/");
    }
651636
public static boolean isSimonUrl(String url) {
		return url != null && url.toLowerCase().startsWith(SimonConnectionConfiguration.URL_PREFIX);
	}
766417
public boolean load(UrlResource urlResource) {
		if (urlResource == null) {
			throw new NullPointerException("Null setting url define!");
		}
		log.debug("Load setting file [{}]", urlResource);
		InputStream settingStream = null;
		try {
			settingStream = urlResource.getStream();
			load(settingStream);
		} catch (Exception e) {
			log.error(e, "Load setting error!");
			return false;
		} finally {
			IoUtil.close(settingStream);
		}
		return true;
	}
624696
File toFile(URL url) {
        String urlstr = url.toExternalForm();
        if(!urlstr.startsWith("file:"))
            return null;

        //  File(String) does fs.normalize, which is really forgiving in fixing up
        // malformed stuff. I couldn't make the other URL.toURI() or File(URI) work
        // in all the cases that we test
        try {
            return new File(URLDecoder.decode(urlstr.substring(5),"UTF-8"));
        } catch (UnsupportedEncodingException x) {
            throw new AssertionError(x);
        }
    }
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);
    }
1117601
public static URL correct(final URL url) throws MalformedURLException {
        if (url == null) {
            throw new MalformedURLException("The url is null");
        }
        return new URL(correct(url.toString(), false));
    }
776486
public static boolean isAsteriskForm(URI uri) {
        return "*".equals(uri.getPath()) &&
                uri.getScheme() == null && uri.getSchemeSpecificPart() == null &&
                uri.getHost() == null && uri.getAuthority() == null && uri.getQuery() == null &&
                uri.getFragment() == null;
    }
453238
public static boolean matchUrl(Account account, String url) {
        for (AccountPatternData pattern : account.getPatterns()) {
            AccountPatternType type = pattern.getType();
            if (type == AccountPatternType.REGEX) {
                if (regexMatch(pattern.getPattern(), url))
                    return true;
            } else if (type == AccountPatternType.WILDCARD) {
                if (globMatch(pattern.getPattern(), url))
                    return true;
            } else {
                Logger logger = Logger.getLogger(AccountPatternMatcher.class.getName());
                logger.warning("Unknown pattern match type '" + type.toString() + "' for account '" +
                        account.getName() + "' id='" + account.getId() + "'");
                // meh
            }
        }
        return account.getUrl().equalsIgnoreCase(url);
    }
219038
public boolean acceptsURL(String url) {

        if (url == null) {
            return false;
        }

        return url.regionMatches(true, 0, DatabaseURL.S_URL_PREFIX, 0,
                                 DatabaseURL.S_URL_PREFIX.length());
    }
806281
public void setUrl(String url) {
        if (url != null && url.trim().length() > 0) {
            if (Url.isUrl(url)) {
                this.url = url;
            } else {
                throw new IllegalArgumentException(url + " is not a valid URL.");
            }
        }
    }
831188
function(url) {
  if (!allowedResources) {
    return true;
  }
  for (var i=0; i<allowedResources.length; i++) {
    var allow = allowedResources[i];
    var index = url.indexOf(allow);
    if (index == 0) {
      return true;
    }
  }
  return false;
}
938913
protected boolean isSarlResource(Object resource) {
		if (resource instanceof IFile) {
			final IFile file = (IFile) resource;
			return getFileExtensions().contains(file.getFileExtension());
		}
		return false;
	}