Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid assumption made about the URI of calendars stored in a CalDAV server #23

Closed
stellingsimon opened this issue Jan 16, 2018 · 0 comments

Comments

@stellingsimon
Copy link
Contributor

We are using ical4j-connector in a setting where it is not the only client communicating with the same CalDAV server. As a result, we may fetch events from a CalDAV server whose URI does not strictly follow the pattern ${eventUID}.ics. The CalDAV standard specifies that the client (which may be a different one than ical4j-connector!) is free to choose URI and UID as long as they are valid. They do not need to be related in any way, although that's admittedly often the case.

We currently cannot update these events through ical4j-connector. The method CalDavCalendarCollection::writeCalendarOnServer takes a Calendar object and a flag isNew, but derives the event's URI from its UID. There is no way for us to specify the URI, even though we know it.

Similarly, the methods CalDavCalendarCollection::removeCalendar and CalDavCalendarCollection::getCalendar take a UID instead of a URI. They can be tricked to work with URIs ending in .ics, but if the suffix isn't present in the URI, events cannot be fetched using ical4j-connector.

I propose the following changes:

  • Add an overload with an additional parameter String eventUri to the methods CalDavCalendarCollection::writeCalendarOnServer, CalDavCalendarCollection::addCalendar and CalDavCalendarCollection::updateCalendar. The existing overloads should stay so that the API is backwards-compatible.
  • Add two new methods CalDavCalendarCollection::getCalendarFromUri and CalDavCalendarCollection::removeCalendarFromUri taking a single argument String uri. The existing getCalendar and removeCalendar should be kept so that the API is backwards-compatible.
@stellingsimon stellingsimon changed the title Invalid assumption made about the URI of events stored in a CalDAV server Invalid assumption made about the URI of calendars stored in a CalDAV server Jan 16, 2018
stellingsimon added a commit to stellingsimon/ical4j-connector that referenced this issue Jan 16, 2018
…ollection under a URI other than `<uid>.ics`
benfortuna added a commit that referenced this issue Jan 18, 2018
…-uid

#23: Allow to create/read/update/delete calendars in a CalDAV collection under a URI other than `<uid>.ics`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants