List of utility methods to do URI Value Check
boolean | isNormalized(String uriName) is Normalized URI uri = URI.create(uriName);
return uri.getPath().equals(uri.normalize().getPath());
|
boolean | isOnTrustedUriWhiteList(final URI uri) Evaluates supplied address against a list of supported internet protocols allowed for use on hyperlinks. if (uri == null || uri.getScheme() == null) { return false; final String protocol = uri.getScheme().toLowerCase(); for (final String allowedProtocol : URI_SCHEME_WHITELIST) { if (protocol.equalsIgnoreCase(allowedProtocol)) { return true; return false; |
boolean | isOriginForm(URI uri) Determine if a uri is in origin-form according to rfc7230, 5.3. return uri.getScheme() == null && uri.getSchemeSpecificPart() == null && uri.getHost() == null
&& uri.getAuthority() == null;
|
boolean | isPrefix(final URI source, final URI other) Checks whether the source URI is a prefix of the other URI. if ((source.getScheme() == null && other.getScheme() != null) || !source.getScheme().equals(other.getScheme())) { return false; final IPath sourcePath = new Path(source.getPath()); final IPath otherPath = new Path(other.getPath()); return sourcePath.isPrefixOf(otherPath); |
boolean | isProjectCacheURI(java.net.URI uri) is Project Cache URI return uri.getScheme().equalsIgnoreCase(CACHE_URI_SCHEME);
|
boolean | isRedirectEndpointUriValid(String redirectUri) According to OAuth 2, section 3.1.2 (Redirect Endpoint), a redirection endpoint MUST be an absolute URI and MUST not include a fragment component. try { URI uri = new URI(redirectUri); return (uri.isAbsolute() && uri.getFragment() == null); } catch (URISyntaxException e) { return false; |
boolean | isRedisSSLScheme(URI uri) is Redis SSL Scheme return REDISS.equals(uri.getScheme());
|
boolean | isRemoteNamespace(URI ns) is Remote Namespace return ns.getScheme().equals("fab") && !ns.isOpaque(); |
boolean | isResolvable(URI toCheck) Determine if a URI is resolvable. try { toCheck.toURL(); } catch (MalformedURLException e) { return false; return true; |
boolean | isResource(URI uri) is Resource String scheme = uri.getScheme(); return scheme.equals("resource") || scheme.equals("classpath") || scheme.startsWith("jar"); |