1 /* CalDAV Extensions test
3 import net.bionicmessage.groupdav.*;
4 import java.util.logging.*;
5 import net.bionicmessage.extutils.*;
8 source ("testcaldav.conf.bsh");
11 String base64 = Base64.encodeBytes((user+":"+pass).getBytes());
12 //String authorization = "Authorization: Basic bWF0dDpiaW9uaWM=";
13 String authorization = "Authorization: Basic "+base64;
15 l = Logger.getLogger("default");
16 l.setLevel(Level.ALL);
17 ConsoleHandler chandler = new ConsoleHandler();
18 chandler.setLevel(Level.ALL);
19 l.addHandler(chandler);
20 CalDAVExtensions cdav = new CalDAVExtensions(server, authorization, l);
21 URL cal = Common.createURL(source, server);
22 boolean supported = cdav.doesSupportCalDAV(cal);
23 cdav.doBasicReport(cal);
24 Map byTimeRange = cdav.getByTimeRange(cal, "VCALENDAR","DTSTART","","");
26 urls = byTimeRange.keySet();
27 Iterator urlIterator = urls.iterator();
28 while(urlIterator.hasNext()) {
29 String url = (String)urlIterator.next();
30 String etag = (String)byTimeRange.get(url);
31 print("URL: " + url + " ETag: " + etag);
33 System.err.println("Supported: " + supported);