List of utility methods to do URI Value Check
boolean | isResourceLocalToServer(URI resourceUri, URI serverUri) Figure out whether the URI is actually local to the server. URI relativeUri = serverUri.relativize(resourceUri);
return !relativeUri.isAbsolute();
|
boolean | isRoot(URI base) is Root String path = base.getPath(); return "/".equals(path) || path.isEmpty(); |
boolean | isRoot(URI uri) is Root try { return parseParentURI(uri) == null ? true : false; } catch (Exception e) { throw new RuntimeException(); |
boolean | isSecure(final URI uri) is Secure final String scheme = uri.getScheme(); return ("https".equals(scheme) || "wss".equals(scheme)); |
boolean | isSecure(URI uri) Check if given URI is "secure", i.e. return uri != null && uri.getScheme().equalsIgnoreCase("https"); |
boolean | isShortTcpURI(URI resource) is Short Tcp URI return resource != null && "tcp".equals(resource.getScheme()) && resource.getHost() != null && resource.getHost().length() <= 256; |
boolean | isSystemIdentifier(URI localIdentifier) is System Identifier return localIdentifier.normalize().toString().equals(LOCAL_SYSTEM_IDENTIFIER.normalize().toString());
|
boolean | isType(URI uri, Class clazz) is Type String simpleName = clazz.getSimpleName(); return uri.toString().startsWith("urn:storageos:" + simpleName); |
boolean | isType(URI uri, String name) is Type return uri.toString().startsWith("urn:storageos:" + name); |
boolean | isURI(Class> type) is URI return type.isAssignableFrom(URI.class); |