/** * Determine if a URI string has a <code>scheme</code> component. * * @param uri The URI to test * * @return {@code true} if a scheme is present, otherwise {code @false} */ public static boolean hasScheme(CharSequence uri) { int len = uri.length(); for(int i=0; i < len ; i++) { char c = uri.charAt(i); if(c == ':') { return i > 0; } else if(!UriUtil.isSchemeChar(c)) { return false; } } return false; }