How do download the content of the files without opening each one?
First of all: What is the problem with downloading the files individually? (via a GET to the URL given) Unless you work with huge amounts of data that should be just fine and can actually be faster if you issue the GETs in parallel.
If the server supports it (most do), you can issue a CalDAV multiget REPORT, RFC 4791 7.9. Also described over here: Building a CalDAV client, example:
REPORT /calendars/johndoe/home/ HTTP/1.1
Depth: 1
Prefer: return-minimal
Content-Type: application/xml; charset=utf-8
Accept: application/xml
<c:calendar-multiget xmlns="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav">
<prop>
<getetag />
<c:calendar-data />
</prop>
<href>/calendars/johndoe/home/132456762153245.ics</href>
<href>/calendars/johndoe/home/fancy-caldav-client-1234253678.ics</href>
</c:calendar-multiget>
Is it possible just to download the calendar entries within a range?
Yes, you can also download data given a time range using the CalDAV calendar-query REPORT. Example:
REPORT /calendars/johndoe/home/ HTTP/1.1
Depth: 1
Prefer: return-minimal
Content-Type: application/xml; charset=utf-8
Accept: application/xml
<calendar-query xmlns:D="DAV:" xmlns="urn:ietf:params:xml:ns:caldav">
<D:prop>
<D:getetag />
<calendar-data />
</D:prop>
<filter>
<comp-filter name="VCALENDAR">
<comp-filter name="VEVENT">
<time-range start="20060104T000000Z"
end="20060105T000000Z"/>
</comp-filter>
</comp-filter>
</filter>
</calendar-query >
What calendar filters are actually supported varies between different servers.
To issue such reports using curl, use -X REPORT
and embed the query using -d
.