code: private boolean isValidProtocol(final String protocol) {
      final int len = protocol.length();
      if (len < 1) {
        return false;
      }
      char character = protocol.charAt(0);
      if (!Character.isLetter(character)) {
        return false;
      }
      for (int i = 1; i < len; i++) {
        character = protocol.charAt(i);
        if (!Character.isLetterOrDigit(character) && character != '.' && character != '+'
            && character != '-') {
          return false;
        }
      }
      return true;
    }
docs: /* Returns true if specified string is a valid protocol name.