From 3051b42ca0f438298e1dc611368ed41165d32d88 Mon Sep 17 00:00:00 2001 From: mguessan Date: Thu, 23 Jul 2009 09:25:57 +0000 Subject: [PATCH] Caldav: untested, extended PROPFIND / response for iPhone 3.0 git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@628 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/caldav/CaldavConnection.java | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/java/davmail/caldav/CaldavConnection.java b/src/java/davmail/caldav/CaldavConnection.java index 9aae1f58..1798dde6 100644 --- a/src/java/davmail/caldav/CaldavConnection.java +++ b/src/java/davmail/caldav/CaldavConnection.java @@ -559,6 +559,29 @@ public class CaldavConnection extends AbstractConnection { } response.endPropStatOK(); response.endResponse(); + if (request.depth == 1) { + response.startResponse("/users"); + response.startPropstat(); + if (request.hasProperty("displayname")) { + response.appendProperty("D:displayname", "users"); + } + if (request.hasProperty("resourcetype")) { + response.appendProperty("D:resourcetype", ""); + } + response.endPropStatOK(); + response.endResponse(); + + response.startResponse("/principals"); + response.startPropstat(); + if (request.hasProperty("displayname")) { + response.appendProperty("D:displayname", "principals"); + } + if (request.hasProperty("resourcetype")) { + response.appendProperty("D:resourcetype", ""); + } + response.endPropStatOK(); + response.endResponse(); + } response.endMultistatus(); response.close(); } @@ -704,7 +727,7 @@ public class CaldavConnection extends AbstractConnection { public void sendUnauthorized() throws IOException { HashMap headers = new HashMap(); headers.put("WWW-Authenticate", "Basic realm=\"" + BundleMessage.format("UI_DAVMAIL_GATEWAY") + '\"'); - sendHttpResponse(HttpStatus.SC_UNAUTHORIZED, headers, null, (byte[])null, false); + sendHttpResponse(HttpStatus.SC_UNAUTHORIZED, headers, null, (byte[]) null, false); } public void sendHttpResponse(int status) throws IOException {