1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-14 11:42:23 -05:00

Caldav: send principal-URL for OSX Lion

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1739 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2011-07-18 21:15:48 +00:00
parent 9c7aab25ad
commit ef4ec59151
2 changed files with 12 additions and 0 deletions

View File

@ -924,6 +924,10 @@ public class CaldavConnection extends AbstractConnection {
response.startResponse(URIUtil.encodePath("/principals/" + prefix + '/' + principal)); response.startResponse(URIUtil.encodePath("/principals/" + prefix + '/' + principal));
response.startPropstat(); response.startPropstat();
if (request.hasProperty("principal-URL")) {
response.appendProperty("D:principal-URL", "/principals/" + prefix + '/' + principal);
}
if (request.hasProperty("calendar-home-set")) { if (request.hasProperty("calendar-home-set")) {
if ("users".equals(prefix)) { if ("users".equals(prefix)) {
response.appendHrefProperty("C:calendar-home-set", "/users/" + actualPrincipal + "/calendar/"); response.appendHrefProperty("C:calendar-home-set", "/users/" + actualPrincipal + "/calendar/");

View File

@ -350,5 +350,13 @@ public class TestCaldav extends AbstractDavMailTestCase {
assertEquals(HttpStatus.SC_MOVED_PERMANENTLY, method.getStatusCode()); assertEquals(HttpStatus.SC_MOVED_PERMANENTLY, method.getStatusCode());
} }
public void testPrincipalUrl() throws IOException, DavException {
DavPropertyNameSet davPropertyNameSet = new DavPropertyNameSet();
davPropertyNameSet.add(DavPropertyName.create("principal-URL", Namespace.getNamespace("DAV:")));
PropFindMethod method = new PropFindMethod("/principals/users/"+session.getEmail(), davPropertyNameSet, 0);
httpClient.executeMethod(method);
method.getResponseBodyAsMultiStatus();
assertEquals(HttpStatus.SC_MULTI_STATUS, method.getStatusCode());
}
} }