CalDAV4j is a java library implementing the CalDAV protocol for the client side implementation.
CalDAV4j makes it easy to issue complex queries to a caldav server, supporting free-busy and calendar-collections. Moreover, it supports the standard adding and removal of events.
High-Level CalDAV API's: This API works at the level of iCal4j objects, and allows for high level operations. All the "hard" protocol work that you need to do to make this happen is hidden from the end user.
Low Level API Access: Let's you work at the Http/WebDAV/CalDAV protocol level by creating instances of HttpMethods (like GetMethod, MkCalendar, ReportMethod, etc.) and executing them.
Flexible query language support: An easy and flexible query language (eg. for events in a given date range); and Recurring event management (eg. updating master events and recurrence instances).
Performance: When possible, caches (such as caches of etags and icalendar resources) are maintained so that network chatter and parsing of icalender files is minimized.
Compliance: We aim to be compliant with the following specs:
Using CalDAV4j in your code
CalDav4j is available currently on Maven Central, thus to add it, you can add a dependancy by adding the following to the
<dependency> <groupId>com.github.caldav4j</groupId> <artifactId>caldav4j</artifactId> <version>0.9.2</version> </dependency>
For more information on how to add CalDAV4j into your code, please refer to: https://search.maven.org/artifact/com.github.caldav4j/caldav4j/
There are two versions currently
0.9.2 (Stable based on HttpClient 3.x) and
1.0.0-rc.1 (Dev branch based on HttpClient 4.x) depending on which version of HttpClient you want to use will determine the version to use.
The unit tests are currently best place right now to see how to use CalDAV4j. Documentation can be found on the wiki
CalDAV4j uses Maven as its build system. To build this project, one must simply install through maven, while skipping all the tests:
mvn install -DskipTests
During package creation, you can test your caldav server replacing the
caldav4jUri with your own custom one.
mvn package -Dcaldav4jUri='https://user:firstname.lastname@example.org/base/user/collections/'
A Docker image of a caldav server, Bedework (~900MB) is distributed via Docker Hub:
docker run -d -p 8080:8080 ioggstream/bedework mvn clean package -Dcaldav4jUri='http://vbede:bedework@localhost:8080/ucaldav/user/vbede/'
Before committing, always reformat your code
mvn -e spotless:apply
CalDAV4j is licensed under the Apache 2.0 License
- Copyright © 2005-2011 Open Source Application Foundation
- Copyright © 2011 - Present Individual Contributors
Contributing Organizations and Individuals
- OSAFoundation (No longer contributing)
CalDAV4j 0.9.2 is the current (tagged) release and 1.0.0-rc.1 is the current development branch.
For the complete changelog, refer to this page.