No body text extracted from multiple event ics file

ICS_Test.zip (5.7 KB)

Aspose Team,
We use the Aspose Email java package to get body text form ics files. If the ics file has multiple BEGIN:VEVENT / END:VEVENT sections, we found out that DESCRIPTION of the first Event is returned as body text (Appointment.getDescription()). If DESCRIPTION of the first Event is empty then body text is empty, even though other BEGIN:VEVENT / END:VEVENT sections may have values for DESCRIPTION.

Wonder if DESCRIPTION of all the BEGIN:VEVENT / END:VEVENT sections can be returned as body text.

Following is the sample code and attached are the sample files.
Single_Event.ics — Single Event with DESCRIPTION, body text is extracted.
Multiple_Event_1.ics — Multiple Event and first Event has no DESCRIPTION, no body text is extracted.
Multiple_Event_2.ics — Multiple Event and first Event has DESCRIPTION, body text is extracted.

The operating system is Ubuntu 20.04. Java version is 21. Aspose Email java packages is 24.5.

import com.aspose.email.Appointment;
import com.aspose.email.AppointmentLoadOptions;

public class GetIcsDescription_30 {
    public static void main(String[] args) {
        try {
            String inputIcs = "/home/ubuntu/winshare/00_Sample_Files/ICS_Test/Multiple_Event_1.ics";
            AppointmentLoadOptions alo = new AppointmentLoadOptions();
            alo.setIgnoreSmtpAddressCheck(true);
            Appointment appointment = Appointment.load(inputIcs, alo);
            String bodyText = appointment.getDescription();
            System.out.println("bodyText = \'" + bodyText + "\'");
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}

Hello @xyang,

It seems you need to use CalendarReader since you are dealing with multiple events:

List<Appointment> appointments = new ArrayList<Appointment>();
CalendarReader reader = new CalendarReader(inputIcs, alo);
while (reader.nextEvent())
{
    appointments.add(reader.getCurrent());
}

Hello @margarita.samodurova

Thank you very much for your suggestion. I will implement accordingly and let you know.

Hello @margarita.samodurova

The suggestion works. Thank you very much.

@xyang ,

Thank you for your feedback! Feel free to contact us if you need any further assistance.