Method that given a URL checks if the resources is static or not - depending on
the request extension like .css, .js, .png etc.

@param uri
@return
963889
private boolean isStaticResource(String uri) {
        // find extension
        int index = uri.lastIndexOf('.');
        if(index == -1) {
            return false; // no extension found
        }

        String currentExtension = uri.substring(index);
        
        return STATIC_RESOURCE_EXTENSIONS.contains(currentExtension);
    }
655847
protected boolean match(final URI uri) {

        final String methodName = "match";
        final String uriStr = prepareUri(uri);

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

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

        return false;
    }
1275133
private Drawable getDrawable(Uri uri) {
        try {
            String scheme = uri.getScheme();
            if (ContentResolver.SCHEME_ANDROID_RESOURCE.equals(scheme)) {
                // Load drawables through Resources, to get the source density information
                try {
                    return getDrawableFromResourceUri(uri);
                } catch (Resources.NotFoundException ex) {
                    throw new FileNotFoundException("Resource does not exist: " + uri);
                }
            } else {
                // Let the ContentResolver handle content and file URIs.
                InputStream stream = mProviderContext.getContentResolver().openInputStream(uri);
                if (stream == null) {
                    throw new FileNotFoundException("Failed to open " + uri);
                }
                try {
                    return Drawable.createFromStream(stream, null);
                } finally {
                    try {
                        stream.close();
                    } catch (IOException ex) {
                        Log.e(LOG_TAG, "Error closing icon stream for " + uri, ex);
                    }
                }
            }
        } catch (FileNotFoundException fnfe) {
            Log.w(LOG_TAG, "Icon not found: " + uri + ", " + fnfe.getMessage());
            return null;
        }
    }
620219
public static boolean isDeprecated(String uri)
    {
    	Datatype datatype = datatypesHash.get(uri);
    	String urn = getOfficialDataTypeURI(datatype);
    	return !uri.equalsIgnoreCase(urn);
    }
714568
protected static boolean isAPIUri(Uri uri) {
        if (uri == null) {
            return false;
        }

        return getBaseUri().getHost().equals(uri.getHost());
    }
597893
public boolean matches(String uri) {
		if (uri == null) {
			return false;
		}
		Matcher matcher = this.matchPattern.matcher(uri);
		return matcher.matches();
	}
431373
public static final String getRelativeURI( HttpServletRequest request, String uri )
    {
        return getRelativeURI( request.getContextPath(), uri );
    }
1361824
public Map<String, URL> getResourcesMap(String uri) throws IOException {
        String basePath = path + uri;

        Map<String, URL> resources = new HashMap<>();
        if (!basePath.endsWith("/")) {
            basePath += "/";
        }
        Enumeration<URL> urls = getResources(basePath);

        while (urls.hasMoreElements()) {
            URL location = urls.nextElement();

            try {
                if (location.getProtocol().equals("jar")) {

                    readJarEntries(location, basePath, resources);

                } else if (location.getProtocol().equals("file")) {

                    readDirectoryEntries(location, resources);

                }
            } catch (Exception e) {
            }
        }

        return resources;
    }
734597
public static Uri getUriFromResource(@NonNull Context context, @AnyRes int resId) throws Resources.NotFoundException {
        /** Return a Resources instance for your application's package. */
        Resources res = context.getResources();
        /**
         * Creates a Uri which parses the given encoded URI string.
         * @param uriString an RFC 2396-compliant, encoded URI
         * @throws NullPointerException if uriString is null
         * @return Uri for this given uri string
         */
        /** return uri */
        return Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE +
                "://" + res.getResourcePackageName(resId)
                + '/' + res.getResourceTypeName(resId)
                + '/' + res.getResourceEntryName(resId));
    }
443765
protected final String prepareUri(final URI uri) {
        if (compareRelative) {
            final String path = uri.getRawPath();
            final String query = uri.getRawQuery();
            final String fragment = uri.getRawFragment();
            if (query != null && fragment != null) {
                return path + "?" + query + "#" + fragment;
            } else if (query != null) {
                return path + "?" + query;
            } else if (fragment != null) {
                return path + "#" + fragment;
            } else {
                return path;
            }
        } else {
            return uri.toString();
        }
    }
620351
public static boolean sameResource(URI uri, String otherResource) {
        try {
            return createUri(otherResource).equals(uri);
        } catch(DataSourceException e) {
            return false;
        }
    }
320404
private boolean checkUrl(String url) {
        try {
            URI uri = new URI(url);
            return uri.isAbsolute();
        } catch (URISyntaxException e) {
            return false;
        }
    }
591130
public UrlMappingInfo match(String uri) {
        for (Pattern pattern : patterns) {
            Matcher m = pattern.matcher(uri);
            if (m.matches()) {
                UrlMappingInfo urlInfo = createUrlMappingInfo(uri, m);
                if (urlInfo != null) {
                    return urlInfo;
                }
            }
        }
        return null;
    }
1253365
def static(request):
    ""
    static_url = settings.STATIC_URL
    prefix = 'src' if settings.DEBUG else 'min'
    return {
        'CSS_URL': os.path.join(static_url, 'stylesheets/css'),
        'IMAGES_URL': os.path.join(static_url, 'images'),
        'JAVASCRIPT_URL': os.path.join(static_url, 'js', prefix),
    }
1795
public static boolean isWorkplaceUri(URI uri) {

        return (uri != null) && uri.getPath().startsWith(OpenCms.getSystemInfo().getWorkplaceContext());
    }
1014450
@Pure
	@Inline(value = "URISchemeType.JAR.isURL($1)", imported = {URISchemeType.class})
	public static boolean isJarURL(URL url) {
		return URISchemeType.JAR.isURL(url);
	}
1060680
private void checkResourceURI(String resourceURI, String relName)
            throws SAXException {

        URI uri;
        try {
            uri = new URI(resourceURI);
        } catch (Exception e) {
            throw new SAXException("RelsExtValidator:"
                    + "Error in relationship '" + relName + "'."
                    + " The RDF 'resource' is not a valid URI.");
        }

        if (!uri.isAbsolute()) {
            throw new SAXException("RelsValidator:" + "Error in relationship '"
                    + relName + "'."
                    + " The specified RDF 'resource' is not an absolute URI.");
        }
    }