code: private static String extractPassword(String userInfo) {
      if (userInfo == null) {
        return null;
      }
      String password = "";
      int index = userInfo.lastIndexOf(':');
      if (index != -1 && index < userInfo.length() - 1) {
        // Extract password from the URL.
        password = userInfo.substring(index + 1);
      }
      return password;
    }
docs: Gets the password from an user info string obtained from the starting URL.
  
  @param userInfo
  userInfo, taken from the URL. If no user info specified returning
  null. If user info not null but no password after ":" then
  returning empty, (we have a user so the default pass for him is
  empty string). See bug 6086.
  
  @return The password.