MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / isValidScheme

Method isValidScheme

vm/JavaAPI/src/java/net/URI.java:589–598  ·  view source on GitHub ↗

Verifies the scheme contains only valid characters as per the URN specification (see NID). @see http://tools.ietf.org/html/rfc2141

(String scheme)

Source from the content-addressed store, hash-verified

587 * @see <a href="http://tools.ietf.org/html/rfc2141">http://tools.ietf.org/html/rfc2141</a>
588 */
589 boolean isValidScheme(String scheme) {
590 for (int i = 0; i < scheme.length(); i++) {
591 char ch = scheme.charAt(i);
592 if (URIHelper.isAlpha(ch) || URIHelper.isNumeric(ch) || ch == '-') {
593 continue;
594 }
595 return false;
596 }
597 return true;
598 }
599
600 /**
601 * Get the scheme part of the URI.

Callers 2

setSchemeMethod · 0.95
parseURIMethod · 0.95

Calls 4

isAlphaMethod · 0.95
isNumericMethod · 0.95
lengthMethod · 0.65
charAtMethod · 0.65

Tested by

no test coverage detected