MCPcopy Create free account
hub / github.com/apache/tomcat / hasScheme

Method hasScheme

java/org/apache/tomcat/util/buf/UriUtil.java:92–103  ·  view source on GitHub ↗

Determine if a URI string has a scheme component. @param uri The URI to test @return true if a scheme is present, otherwise {code @false}

(CharSequence uri)

Source from the content-addressed store, hash-verified

90 * @return {@code true} if a scheme is present, otherwise {code @false}
91 */
92 public static boolean hasScheme(CharSequence uri) {
93 int len = uri.length();
94 for (int i = 0; i < len; i++) {
95 char c = uri.charAt(i);
96 if (c == ':') {
97 return i > 0;
98 } else if (!isSchemeChar(c)) {
99 return false;
100 }
101 }
102 return false;
103 }
104
105
106 /**

Callers 2

invokeMethod · 0.95
toAbsoluteMethod · 0.95

Calls 3

isSchemeCharMethod · 0.95
lengthMethod · 0.80
charAtMethod · 0.80

Tested by

no test coverage detected