Problems Reading iCalendar Files From Mozilla Calendar

From JSyncManagerWiki

Jump to: navigation, search

A common problem for developers working with the jSyncManager's new iCalendar support classes is trying to correctly parse data created by Mozilla Calendar and Mozilla Sunbird.

The problem stems from two factors:

  • Mozilla Calendar generates non-conformant iCalendar data files (see Bugzilla Report #273039), and
  • Unlike other iCalendar parsers, the jSyncManager iCalendar support classes are only attempting to "unfold" long lines of text if they'd extend beyond the 75th octet, as per RFC 2445. Most other iCalendar parsers appear to run the iCalendar data file through a file-wide unfolder prior to parsing.

The jSyncManager Development Team has implemented a fix for this issue, which involves the class org.jSyncManager.API.Tools.UnfolderInputStream. This class derives from Java's java.io.InputStream class, allowing you to wrap the input stream being used to read the iCalendar data into it, automatically performing a file-wide unfolding.

Using the UnfolderInputStream class as part of your iCalendar I/O routine prior to passing it to the jSyncManager's iCalendar parser will ensure your Mozilla Calendar/Sunbird data is parsed correctly. The UnfolderInputStream is harmless to RFC 2445 comformant iCalndar data, so you can safely use it for any iCalendar file you might encounter.

Personal tools