private static boolean isValidScheme(final String scheme){
  final int length=scheme.length();
  if (length <= 0) {
    return false;
  }
  char c=scheme.charAt(0);
  if (!Character.isLetter(c)) {
    return false;
  }
  for (int i=1; i < length; i++) {
    c=scheme.charAt(i);
    if (!Character.isLetterOrDigit(c) && c != '.' && c != '+' && c != '-') {
      return false;
    }
  }
  return true;
}

private static boolean isValidScheme ( final String scheme ) { final int length = scheme . length ( ) ; if ( length <= 0 ) { return false ; } char c = scheme . charAt ( 0 ) ; if ( ! Character . isLetter ( c ) ) { return false ; } for ( int i = 1 ; i < length ; i ++ ) { c = scheme . charAt ( i ) ; if ( ! Character . isLetterOrDigit ( c ) && c != '.' && c != '+' && c != '-' ) { return false ; } } return true ; }
checks if it is a valid scheme .
