List of utility methods to do URI Value Check
boolean | isURI(String plainString) is URI try { URL url = new URL(plainString); URI uri = new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath(), url.getQuery(), url.getRef()); return true; } catch (URISyntaxException | MalformedURLException e) { return false; |
boolean | isURI(String uri) isURI. try { new URI(uri); return true; } catch (URISyntaxException e) { return false; |
boolean | isUriValid(String uri) is Uri Valid uri = uri.trim(); if (responseCodeOfURI(uri) == 200) return true; return false; |
boolean | isUsingNonDefaultPort(URI uri) Returns true if the specified URI is using a non-standard port (i.e. String scheme = uri.getScheme().toLowerCase(); int port = uri.getPort(); if (port <= 0) return false; if (scheme.equals("http") && port == 80) return false; if (scheme.equals("https") && port == 443) return false; ... |
boolean | isValid(String uri) is Valid try { return isValid(new URI(uri)); } catch (URISyntaxException e) { return false; |
boolean | isValid(URI uri) is Valid if (isEmpty(uri.getScheme()) || isEmpty(uri.getHost()) || uri.getPort() == -1) { return false; return true; |
boolean | isValidURI(final String namespace) Determine if the supplied name is a valid URI. if (namespace == null || namespace.length() == 0) return false; try { new java.net.URI(namespace); } catch (final URISyntaxException e) { return false; return true; ... |
boolean | isValidURI(String uri) return true if this is a valid uri boolean result = false; try { new URI(uri); result = true; } catch (Exception e) { return result; |
boolean | isValidUri(String uri, StringBuilder errMsg) Tests whether the given URI matches RFC-2396 specs. boolean ret = true; if (uri == null) { if (errMsg != null) { errMsg.append("URI is null"); ret = false; } else { try { ... |
boolean | isValidUri(String uriCandidate) is Valid Uri try { new URI(uriCandidate); } catch (URISyntaxException e) { return false; return true; |