-
Notifications
You must be signed in to change notification settings - Fork 44
Changelog
Regarding backwards-compatibility: Regrettably, I have not been formally adhering to semantic versioning convention when assigning version numbers to each release. Each release may or may not introduce API changes that break builds.
January 7, 2024
- Fixed a bug with parsing duration strings (Issue 127).
- Fixed a timezone issue (Issue 126).
- Improved XML XXE protection for xCards.
February 3, 2023
- Fixed an issue with recurrence date generation where recurrences that use BYSETPOS where skipping the first date and not including the time component (Issue 122).
- Added "Automatic-Module-Name" to JAR file manifest (PR 112).
- Updated dependency libraries to latest versions.
January 10, 2021
- A default timezone can be specified during parsing via
ICalReader.setDefaultTimezone
(or using thedefaultTimezone
method in the chaining API). This allows you to change the timezone that floating date values and date values with invalid timezone definitions are parsed under (by default, the local machine's default timezone is used for such values). - TZID values starting with "/mozilla.org/20050126_1" are now recognized.
- You can now customize the way TZID global IDs are resolved via
ICalReader.setGlobalTimezoneIdResolver
. - Updated dependency libraries to latest versions.
November 8, 2020
- Fixed an issue where locale-specific digit characters were used in timestamps and other numeric values.
October 7, 2020
- Fixed an issue where recurrences with UNTIL parameters would not stop iterating at the correct date under certain time zones (PR 63, Issue 67, Issue 74, Issue 99, Issue 101).
- Fixed an issue where recurrences with BYSETPOS parameters would not iterate correctly (Issue 89).
- Fixed an issue where the
DateIterator.advanceTo()
method was skipping dates it wasn't supposed to skip (Issue 69). - Updated dependency libraries to latest versions.
- Increased minimum required Java version from 5 to 6. Java 5 is no longer supported by newer JDKs.
December 23, 2018
- Updated dependency libraries to latest versions.
April 7, 2018
- Fixed mutability issue in
Recurrence.Builder
copy constructor (Issue 68). - Added the ability to turn off line folding from the chaining API (
foldLines()
method). - Folded property values encoded in quoted-printable are no longer indented (see this and this issue).
- Fixed issue where the
all()
method in the chaining parser API was not considering custom scripts. - Fixed a number formatting issue with certain non-English locals (Pull 72).
- Fixed an issue that prevented a iCalendar file from being parsed if its VTIMEZONE definition contained a DTSTART property that lacked a time component (Issue 77).
- If the recurrence rule in a timezone definition lacks a FREQ component, default to YEARLY (Issue 84).
- Updated vinnie dependency to support OSGi.
February 19, 2017
- Fixed a bug that prevented the
Biweekly
class from writing iCalendar objects to a file. - Exposed the property value string constants of all "enum" property classes (for example,
Method.REQUEST
). - Fixed a bug that prevented duration values beginning with "+" from being parsed.
- Improved performance of date parsing.
- Added support for the following timestamp formats:
- Timestamps that lack the minute component of the UTC offset (e.g. "20161231T131000-05").
- Timestamps that contain a fraction-of-a-second component (e.g. "20161231T131000.1548").
- Fixed an issue regarding how characters are escaped in version 1.0 iCalendar objects (see this issue).
- Parse warnings are now represented by the
ParseWarning
class, instead of a String. This gives you access to more information about the warning, such as the warning code and line number.
October 8, 2016
- Refactored plain-text serialization code to use the vinnie library. This library provides generic read/write support for vCard and iCalendar file formats. This causes the following changes in biweekly:
- biweekly is now aware of differences in how the iCalendar versions handle whitespace at the beginning of folded lines. Version 1.0 allows multiple whitespace characters to be used, while version 2.0 only allows a single whitespace character to be used.
- Escape sequences are no longer recognized in property names or parameter names (this was never intentional in the first place). For example, previously, the newline escape sequence in the property name "HELLO\nWORLD" would have been replaced with a real newline sequence when parsed.
- The
\n
newline escape sequence and\"
double quote escape sequence are no longer recognized in parameter values, due to not being spec-compliant. Consider enabling circumflex accent encoding if you want to insert these characters into a parameter value. - The individual items in list property values (such as CATEGORIES) are no longer trimmed when parsed. For example,
CATEGORIES:one, two, three
now yields the list["one", " two", " three"]
(notice the space character at the beginning of the last two strings).
- Significantly refactored the code that calculates the dates in recurrence rules (originally taken from the google-rfc-2445 project).
- Removed all serialization code, as it was not used by biweekly.
- Removed code that was duplicated in biweekly. For example, the
RRule
class was removed and replaced with biweekly'sRecurrence
class. - Improved the Javadocs.
- Refactored certain parts of the code and unit tests for readability.
July 13, 2016
- Added XXE protection when parsing xCals.
- Fixed some issues regarding iterating over the dates in a recurrence iterator for an all-day event (an event where the start date does not have a time component) (Issue 47).
- Fixed a bug that prevented an iCalendar object from being read if it didn't have a VERSION property.
ICalReader
now assumes the iCalendar object being parsed is in 2.0 format until it encounters aVERSION
property. This can be changed by callingICalReader.setDefaultVersion()
(Issue 48). - Fixed a bug with recurrence rule date iterators that occurred when the
DateIterator.advanceTo()
method was used (Issue 49). - The
TzUrlDotOrgGenerator
class now returns a copy of the VTIMEZONE component it downloads so that its cached copy cannot get modified. - The
TzUrlDotOrgGenerator
class no longer implementsVTimezoneGenerator
. - Removed the
VTimezoneGenerator
interface. - Improved the way in which timezone definitions are handled:
- The
TimezoneInfo
object that used to be associated with the reader/writer classes is now associated with theICalendar
object itself. This is useful for when you want to calculate the dates in a recurrence rule, which needs to know the original timezone the start date was formatted in. - Timezone definitions are now stored in a
TimezoneAssignment
object. This object couples a JavaTimeZone
object with its equivalent (a) VTIMEZONE component or (b) global ID. - The TZID properties of VTIMEZONE components are no longer required to be the same as the ID of their equivalent Java
TimeZone
objects when writingICalendar
objects. - Added a convenience method to the writer classes (
setGlobalTimezone()
) that lets you set a timezone to format all date/time values in, regardless of each individualICalendar
's timezone definitions.
- The
May 17, 2016
- Improved this library's multimap implementation (
ListMultimap
) so thatList
objects returned by itsget()
method are backed by the multimap. In other words, any changes that are made to theseList
objects will update the multimap, and vice versa. This effects the following:-
List
objects returned by theICalendar
class and other component classes, which hold property and component objects. -
List
objects returned by theICalParameters
class, which hold parameter values.
-
- In response to the above change, various "add/remove" methods were removed from the property classes that simply added and removed elements from a
List
(for exampleRecurrenceDates.addDate()
). This was done to remove cruft from the API. Instead, use the getter method to get theList
object, and perform your modifications on that. - Added support for draft-ietf-calext-extensions.
- Added helper methods to the
Method
property class to support the values defined in RFC 5546. - Added a
getDateIterator()
method to certain component classes (such as VEVENT). The iterator returned by this method iterates over all the dates that are defined by the union of the RRULE, RDATE, EXRULE, and EXDATE properties. - Fixed some bugs in the way that the
RecurrenceRule.getDateIterator()
method iterated over the dates in a RRULE. - Modified serialization logic to ensure that the VERSION and PRODID properties are the first properties to be written (in that order). This is not required by the specs, but may help with interoperability.
- Modified serialization logic to ensure that the VTIMEZONE components are the first components to be written. This is not required by the specs, but may help with interoperability.
- Improved performance when parsing iCalendars that have date property values which reference VTIMEZONE components.
- Fixed multiple issues with the ATTACH property not handling Content ID values correctly.
- Fixed an issue with VEVENT validation where it thought CANCELLED was a valid status value under vCal 1.0.
- Improved jCal (JSON) pretty printing by making use of jackson's pretty printing framework.
- Added optional support for jackson-databind.
- Renamed the various
indent()
methods for jCals toprettyPrint()
. - Fixed an issue with xCals where experimental properties with "unknown" data types were parsed incorrectly under certain circumstances.
- Fixed a round-tripping issue with xCals and jCals where experimental properties with backslash-escaped characters were double-escaped when parsed.
- The names of experimental properties in xCals are now converted to upper-case when parsed.
- Updated the embedded commons-codec code to the latest version (1.10).
- Removed unnecessary commons-codec source files.
- Moved the google-rfc2445 source files to a different package to prevent conflicts if the library is already on the classpath.
February 6, 2016
- Added
equals()
andhashCode()
methods to all component, property, and parameter classes. This allows you to check twoICalendar
objects for value equality. - Added the ability to make deep copies of component and property objects. For example, to make a copy of an
ICalendar
object, simply invoke its copy constructor. - Added useful
toString()
methods to all component and property classes. - Relaxed the logic that checks property names for validity before writing them to an output stream. Before, it would throw an exception if a property name contained any characters not allowed by the specifications. Now, it only throws an exception if the property name contains a character that breaks the syntax (such as newline sequences and colon characters). Spec-compliant character checks have been moved to the validation framework (see ICalendar#validate()).
- Parameter values are no longer quietly modified to remove or replace invalid characters. All characters are now allowed, except for the ones that break the syntax (in which case, an exception is thrown). Spec-compliant character checks have been moved to the validation framework (see ICalendar#validate()).
- Fixed a bug that prevented period date/time values from being parsed according to their assigned timezones.
- Fixed a bug that prevented ATTENDEE and ORGANIZER properties from being parsed correctly if the value's URI scheme ("mailto") was in upper case.
- Prevented UTF-16 surrogate pairs from being split up across folded lines.
- Improved performance by removing some regular expressions.
- Renamed
XCalDocument.add(ICalendar)
toaddICalendar(ICalendar)
. - Improved the return values of some of the
ICalComponent
class's getter/setter methods. For example,removeProperty()
now returnstrue
if the property was found. - Moved exception messages into a resource bundle.
November 15, 2015
- Fixed an issue where biweekly would consume multiple whitespace characters when reading a folded line under certain circumstances. This was in conflict with the specifications, which state that folded lines must begin with only one whitespace character (see Ticket 12).
- Fixed problem with outputting dates without time components (see Ticket 13).
- Added the ability to specify the XML version when writing xCals. Note that most JDKs only support version 1.0 natively, so you'll need to include a library like xalan if you want XML 1.1 support.
- Added the ability to specify your own, custom JAXP output properties when writing xCals.
- Made the parsing of folded, quoted-printable properties more robust by refactoring the way biweekly parses input.
September 13, 2015
- Fixed a bug where the UNTIL component of the RRULE property wasn't being written correctly under certain circumstances (see Ticket 10)
- Fixed an issue where TZID parameters were not matching the VTIMEZONE component's TZID property for certain timezones (see Ticket 11).
- UtcOffset class now stores its value in milliseconds instead of hours/minutes.
- Updated jackson dependency from 2.5.2 to 2.6.1.
- Javadoc improvements
May 5, 2015
- Fixed a bug where RECURRENCE-ID properties with timezones were not being parsed properly (see: https://sourceforge.net/p/biweekly/discussion/help-and-support/thread/3ab80a3f/).
- Updated jackson dependency (for jCard parsing) to latest version.
January 15, 2015
- Fixed a bug with the
RecurrenceProperty.getDateIterator()
method that caused dates to be returned in the wrong timezone.
November 29, 2014
- Added much improved time zone support.
- Date-time values are now parsed according to the VTIMEZONE components in the iCalendar object. Before, the VTIMEZONE components were ignored and the date-time value would be parsed according to the TZID parameter value (it was assumed that the TZID would be an Olsen timezone ID).
- All timezone information is now stored in a
TimezoneInfo
object. VTIMEZONE components are removed from the parsedICalendar
object and stored in theTimezoneInfo
object. - To set the default time zone that all date-time values are formatted in, call
ICalWriter.getTimezoneInfo().setDefaultTimeZone()
. - Introduced a new
ICalDate
object, which is now used in most date/time property values. This class extendsjava.util.Date
and has ahasTime
field, which flags the object as either a "date/time" or "date" value. This means that methods likeDateStart.hasTime()
have been removed, since this information is now stored in the property'sICalDate
object.
- Added support for the older vCalendar standard.
- vCalendar files are automatically converted to the newer iCalendar data model.
-
ICalendar
objects can be written according to either the old vCalendar standard or the new iCalendar standard.
-
RecurrenceDates
property class: If a parsed RDATE property only contains periods, then RecurrenceDates.getDates() will be empty (instead of null). Similarly, if the property only contains dates, then RecurrenceDates.getPeriods() will be empty (instead of null). - Added a
getDateIterator()
method to theRecurrenceRule
andExceptionRule
property classes. This allows you to iterate over all of the dates as defined by the recurrence rule. - Added optional dependency definitions to the OSGi bundle settings.
May 31, 2014
- Added a streaming API for xCals (
XCalReader
,XCalWriter
). - Fixed a bug where
<unknown>
property values in xCal documents weren't being parsed correctly. - Removed a regular expression used in parsing code to improve performance.
- Renamed all "marshaller" classes to "scribes" (e.g. renamed "DescriptionMarshaller" to "DescriptionScribe"). Also moved the marshaller classes from "biweekly.(property/component).marshaller" to "biweekly.io.scribe.(property/component)".
- Writer classes now check to make sure a scribe class exists for each property before writing anything to the output stream.
- Improved unit test coverage.
- Upgraded jackson dependency from version 2.1.3 to 2.3.3.
January 22, 2014
- Added OSGi support.
- Added validation and parser warnings to a resource bundle for internationalization.
- Fixed a bug that prevented large plain-text iCalendar streams from being read (see: discussion, credit: Jordy)
- When writing plain-text and JSON-encoded iCalendar objects with the
Biweekly
class, the stream is now flushed after every iCalendar object is written (see Ticket 4, credit: Romain Gonord).
September 21, 2013
Major changes
-
Improved UTF-8 support: UTF-8 encoding is now used essentially whenever a
File
orInputStream/OutputStream
object is passed into one of biweekly's reader/writer classes. JavaReader/Writer
objects are not effected by this change because they are configured to use their own character encoding.- If a
File
orOutputStream
object is passed into a writer class, UTF-8 encoding will be used. - If a
File
orInputStream
object is passed into a plain-text iCal or jCal reader, UTF-8 encoding will be used. - If a
File
orInputStream
object is passed into a xCal reader, the "encoding" attribute in the header portion of the XML document will be properly taken into account. Before, it was ignored and the document was parsed according to the JVM's default character encoding.
- If a
- Added support for the EXRULE property.
- RRULE now supports non-standard rule parts.
-
"Duration" class improvements: Added the following methods to the
Duration
class (credit: Caruyer Perrine):-
toMillis()
- Converts the duration to milliseconds -
add(Date)
- Adds the duration to a Date object -
diff(Date, Date)
- Factory method that builds aDuration
from the difference between two Dates -
fromMillis(long)
- Factory method that builds aDuration
from a milliseconds value
-
Other changes:
- Added the ability to append onto existing files when writing plain-text files with the
Biweekly
class. - The
Biweekly.parse(File)
methods no longer throw aFileNotFoundException
. - The
ICalParameter.getRsvp()
method now throws anIllegalStateException
when the RSVP parameter value cannot be parsed (i.e. if it's something other than "true" or "false"). Before, it would return "null", which was misleading ("null" typically means that the parameter does not exist). Raw parameter values can still be retrieved using theget()
method. - A
CannotParseException
is now consistently thrown during the parsing of xCal properties when the XML element which holds the property's value cannot be found. - When marshalling to xCard, if a property's value is null (a rare occurrence), then an empty XML element will be written (before, no element was written). This increases conformance with the xCard schema.
- Created the
ICalMarshallerRegistrar
class, which can be used to assign a set of custom marshallers to a reader or writer class. - Improved the performance of plain-text iCal marshalling by optimizing string escaping functions.
- Changed
JCalValue.asStructured()
andJCalValue.structured()
so they properly support multi-valued structured components. - Renamed the "Value" class to "ICalDataType" and improved data type abstraction in the data model.
- Moved
ValidationWarnings
class from thebiweekly.component
package to thebiweekly
package. - Renamed the following methods:
-
ICalPropertyMarshaller.Result.getValue
-->getProperty
-
ICalPropertyMarshaller.getDataType
-->dataType
-
JCalValue.getSingleValued
-->asSingle
-
JCalValue.getMultivalued
-->asMulti
-
JCalValue.getStructured
-->asStructured
-
- Added syntax highlighting to the code samples in the Javadocs. :)
August 4 2013
- Added jCal support (JSON-encoded iCalendar objects).
- Removed the "commons-codec" dependency.
- Fixed a bug that prevented non-standard parameter values from being parsed.
- Fixed a bug that prevented an iCalendar object from being parsed if the parser encountered a value-less parameter. A warning is now also logged if it encounters such a parameter, since value-less parameters are not permitted by the specs (see Ticket 1).
- Fixed a bug that prevented
VJOURNAL
components from being read/written correctly (its marshaller class was missing). - The
TZID
parameter is now taken into account when reading/writing theRDATE
property. - Added
setLocalTime(boolean)
method to certain date-time classes which instructs the library to format the timestamp according to local time (default timezone) when written. - The
DTSTART
property is now formatted according to local time (default timezone) when part of aSTANDARD
orDAYLIGHT
component (timezone definition). - Added getter/setter methods to the
VEvent
andVTodo
classes forVALARM
components. - The
ICalWriter
class no longer logs warnings. - The
ICalWriter
class now throws anIllegalArgumentException
if it cannot find the marshaller class of a property or component object. - Validation changes:
- Property parameters are now validated when
ICalendar.validate()
is called. Each parameter is checked to make sure its value is valid (for example, confirming thatRSVP
is either "true" or "false") (see Ticket 2). - The values of the
ACTION
,CALSCALE
,CLASS
,STATUS
, andTRANSP
properties are now checked to ensure they use an acceptable value. - Validation warnings are now wrapped in a
ValidationWarnings
object. TheValidationWarnings
object contains a list ofWarningsGroup
objects. EachWarningsGroup
object contains a reference to the property/component that caused the warnings, references to the property/component's parent components, and a list of the validation warnings.
- Property parameters are now validated when
- Added the ability to get/set the raw components of a date-time value for certain properties (see Ticket 3). This is useful for getting/setting the value of the
DTSTART
properties that are located withinVTIMEZONE
components.
July 7 2013
- Added xCal support (XML-encoded iCalendar objects).
- Added property cardinality validation to
ICalendar.validate()
.
June 25 2013
- First release.
biweekly is maintained by Michael Angstadt
Table of Contents
Getting started
Examples
FAQ
Javadocs
Downloads
1 An Overview of the iCalendar data format
2 Reading and Writing iCalendar data with biweekly
2.1 Plain-text (traditional)
2.2 XML-encoded (xCal)
2.3 JSON-encoded (jCal)
4 Working with Timezones
4.1 0.4.6 and earlier
4.2 0.5.0 and later
5 Dealing with Non-standard Data
5.1 Non-standard components
5.2 Non-standard properties
5.3 Non-standard parameters
6 Project Information
6.1 Dependencies
6.2 Supported Specifications
6.3 Changelog
7 Reference
7.1 iCalendar Component Reference
7.2 iCalendar Property Reference
7.3 Javadocs