List of utility methods to do URI Value Check
boolean | isAbsoluteURI(String path) is Absolute URI return URI.create(path).isAbsolute();
|
boolean | isAbsoluteURI(String uri) This is the same logic that we have in the runtime, in PageFlowRequestProcessor. if (uri.length() == 0 || uri.charAt(0) == '/') return false; for (int i = 0, len = uri.length(); i < len; ++i) { char c = uri.charAt(i); if (c == ':') { return true; } else if (c == '/') { return false; ... |
boolean | isAbsoluteUri(String uriAsString) Determines whether a string is an absolute URI. boolean result; try { URI uri = urlToUri(uriAsString); result = uri.isAbsolute(); } catch (Exception e) { result = false; return result; ... |
boolean | isAnyAddress(final URI u) is Any Address return u.getHost() == null && (u.getAuthority().equals("*") || u.getAuthority().startsWith("*:")); |
boolean | isAvailable(URI address) is Available try { InetAddress addr = InetAddress.getByName(address.getHost()); int port = address.getPort(); if (port == -1) { return false; SocketAddress sockaddr = new InetSocketAddress(addr, port); Socket sock = new Socket(); ... |
boolean | isBagUri(final URI uri) Returns true if the scheme for uri is equal to bag , otherwise it returns false. if (uri == null) { return false; return BAG_URI_SCHEME.equals(uri.getScheme()); |
boolean | isBase(URI base, URI uri) is Base String path = uri.getRawPath(); if (path == null || "/".equals(path)) { return true; if (base != null) { URI rel = base.relativize(uri); if (rel.getRawPath() == null || rel.getRawPath().length() <= 0 || rel.equals(uri)) { return true; ... |
boolean | isDefaultPort(URI uri) Returns true if the specified URI uses a standard port (i.e. String scheme = uri.getScheme().toLowerCase(); int port = uri.getPort(); return port <= 0 || (port == 80 && scheme.equals("http")) || (port == 443 && scheme.equals("https")); |
boolean | isDirectory(URI orig) If there is a directory at the other end of this URI return true. if (!orig.getScheme().equals(PROTOCOL_FILE)) { return false; return new File(orig.getPath()).isDirectory(); |
boolean | isExtensionUri(final URI uri) is Extension Uri return uri.toString().startsWith(EXT_URI_PREFIX);
|