code: protected String scanScheme(String uri)
    {
      int i = 0;
      if (uri == null)
        return null;
  
      int length = uri.length();
      if (length == 0)
        return null;
  
      int ch = uri.charAt(0);
      if (ch >= 'a' && ch <= 'z' ||
          ch >= 'A' && ch <= 'Z') {
        for (i = 1; i < length; i++) {
          ch = uri.charAt(i);
  
          if (ch == ':')
            return uri.substring(0, i).toLowerCase(Locale.ENGLISH);
  
          if (! (ch >= 'a' && ch <= 'z' ||
                 ch >= 'A' && ch <= 'Z' ||
                 ch >= '0' && ch <= '0' ||
                 ch == '+' || ch == '-' || ch == '.'))
            break;
        }
      }
  
      return null;
    }
docs: Returns the scheme portion of a uri.  Since schemes are case-insensitive,
  normalize them to lower case.