List of utility methods to do URI Value Check
boolean | isValidURI(String uriRef) is Valid URI boolean isValid = !uriRef.matches("[\u0000-\u001F\u007F-\u009F]"); try { final java.net.URI uri = new java.net.URI(uriRef); isValid = uri.isAbsolute(); } catch (URISyntaxException e) { isValid = false; return isValid; ... |
boolean | isValidURIorEmpty(String uri) Check if the given input string is a valid URI if (uri == null || uri.trim().isEmpty()) { return true; try { URI.create(uri); return true; } catch (Exception e) { return false; ... |
boolean | isValidURIReference(String uriRef) Verifies that the supplied string is a valid RDF (1.0) URI reference, as defined in section 6.4 of the RDF Concepts and Abstract Syntax specification (RDF 1.0 Recommendation of February 10, 2004). boolean valid = !uriRef.matches("[\u0000-\u001F\u007F-\u009F]"); if (valid) { final String escaped = escapeExcludedChars(uriRef); try { final java.net.URI uri = new java.net.URI(escaped); valid = uri.isAbsolute(); } catch (URISyntaxException e) { valid = false; ... |
boolean | isVirtual(URI locationURI) see issue 12500: we should check whether the resource is virtual TODO as soon as 3.5 is not supported, use resource.isVirtual() call return locationURI == null || "virtual".equals(locationURI.getScheme()); |
boolean | isVSO(final URI uri) is VSO final String host = uri.getHost().toLowerCase(); if (host.endsWith(HOST_VSO) || host.endsWith(HOST_TFS_ALL_IN)) { return true; } else { return false; |
boolean | isWellFormedUriString(final String uriString) is Well Formed Uri String try { new URI(uriString); return true; } catch (final URISyntaxException ignored) { return false; |
URI | validateURI(final String uri) Just test to see if the given string can be parse into a URI. try { return new URI(uri); } catch (final Exception mfue) { return null; |
void | validateUri(String uri) validate Uri try { new URI(uri); } catch (Exception e) { throw new Error(e); |
String | validateURI(String uri) Verifies the validity of a complete URI try { new URI(uri); } catch (URISyntaxException e) { throw e; return uri; |
String | validateUri(String uri) validate Uri final URL url; try { url = new URL(uri); } catch (Exception e1) { return ("'" + uri + "' is not a valid URL: " + e1.getLocalizedMessage()); if (!"http".equals(url.getProtocol())) { return ("'" + uri + "' is not a valid URL: Model name must use http protocol."); ... |