code: private static String extractUser(String userInfo) {
      if (userInfo == null) {
        return null;
      }
  
      int index = userInfo.lastIndexOf(':');
      if (index == -1) {
        return userInfo;
      } else {
        return userInfo.substring(0, index);
      }
    }
docs: Gets the user from an userInfo string obtained from the starting URL. Used
  only by the constructor.
  
  @param userInfo
  userInfo, taken from the URL.
  @return The user.