Java Code Examples for org.apache.jackrabbit.webdav.DavMethods#METHOD_REPORT
The following examples show how to use
org.apache.jackrabbit.webdav.DavMethods#METHOD_REPORT .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestCaldavHttpClient4.java From davmail with GNU General Public License v2.0 | 6 votes |
public void testReportInbox() throws IOException { String buffer = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<C:calendar-query xmlns:C=\"urn:ietf:params:xml:ns:caldav\" xmlns:D=\"DAV:\">" + "<D:prop>" + "<C:calendar-data/>" + "</D:prop>" + "<C:filter>" + "</C:filter>" + "</C:calendar-query>"; BaseDavRequest method = new BaseDavRequest(URI.create("/users/" + session.getEmail() + "/inbox/")) { @Override public String getMethod() { return DavMethods.METHOD_REPORT; } }; method.setEntity(new StringEntity(buffer, ContentType.create("text/xml", "UTF-8"))); httpClient.executeDavRequest(method); }
Example 2
Source File: TestCaldavHttpClient4.java From davmail with GNU General Public License v2.0 | 6 votes |
public void testReportTasks() throws IOException { String buffer = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<C:calendar-query xmlns:C=\"urn:ietf:params:xml:ns:caldav\" xmlns:D=\"DAV:\">" + "<D:prop>" + "<C:calendar-data/>" + "</D:prop>" + "<C:comp-filter name=\"VCALENDAR\">" + "<C:comp-filter name=\"VTODO\"/>" + "</C:comp-filter>" + "<C:filter>" + "</C:filter>" + "</C:calendar-query>"; BaseDavRequest method = new BaseDavRequest(URI.create("/users/" + session.getEmail() + "/calendar/")) { @Override public String getMethod() { return DavMethods.METHOD_REPORT; } }; method.setEntity(new StringEntity(buffer, ContentType.create("text/xml", "UTF-8"))); httpClient.executeDavRequest(method); }
Example 3
Source File: TestCaldavHttpClient4.java From davmail with GNU General Public License v2.0 | 6 votes |
public void testReportEventsOnly() throws IOException { String buffer = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<C:calendar-query xmlns:C=\"urn:ietf:params:xml:ns:caldav\" xmlns:D=\"DAV:\">" + "<D:prop>" + "<C:calendar-data/>" + "</D:prop>" + "<C:comp-filter name=\"VCALENDAR\">" + "<C:comp-filter name=\"VEVENT\"/>" + "</C:comp-filter>" + "<C:filter>" + "</C:filter>" + "</C:calendar-query>"; BaseDavRequest method = new BaseDavRequest(URI.create("/users/" + session.getEmail() + "/calendar/")) { @Override public String getMethod() { return DavMethods.METHOD_REPORT; } }; method.setEntity(new StringEntity(buffer, ContentType.create("text/xml", "UTF-8"))); httpClient.executeDavRequest(method); }
Example 4
Source File: TestCaldavHttpClient4.java From davmail with GNU General Public License v2.0 | 6 votes |
public void testInvalidDavRequest() { BaseDavRequest method = new BaseDavRequest(URI.create("/users/" + session.getEmail() + "/calendar/")) { @Override public String getMethod() { return DavMethods.METHOD_REPORT; } }; method.setEntity(new StringEntity("invalid", ContentType.create("text/xml", "UTF-8"))); try { httpClient.executeDavRequest(method); fail("Should fail"); } catch (IOException e) { assertNotNull(e.getMessage()); assertEquals(503, ((DavException)e.getCause()).getErrorCode()); } }
Example 5
Source File: TestCaldavHttpClient4.java From davmail with GNU General Public License v2.0 | 5 votes |
public void testReportCalendar() throws IOException { SimpleDateFormat formatter = ExchangeSession.getZuluDateFormat(); Calendar cal = Calendar.getInstance(); Date end = cal.getTime(); cal.add(Calendar.MONTH, -1); Date start = cal.getTime(); BaseDavRequest method = new BaseDavRequest(URI.create("/users/" + session.getEmail() + "/calendar/")) { @Override public String getMethod() { return DavMethods.METHOD_REPORT; } }; String buffer = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<C:calendar-query xmlns:C=\"urn:ietf:params:xml:ns:caldav\" xmlns:D=\"DAV:\">" + "<D:prop>" + "<C:calendar-data/>" + "</D:prop>" + "<C:comp-filter name=\"VCALENDAR\">" + "<C:comp-filter name=\"VEVENT\">" + "<C:time-range start=\"" + formatter.format(start) + "\" end=\"" + formatter.format(end) + "\"/>" + //"<C:time-range start=\"" + formatter.format(start) + "\"/>" + "</C:comp-filter>" + "</C:comp-filter>" + "<C:filter>" + "</C:filter>" + "</C:calendar-query>"; method.setEntity(new StringEntity(buffer, ContentType.create("text/xml", "UTF-8"))); MultiStatus multiStatus = httpClient.executeDavRequest(method); MultiStatusResponse[] responses = multiStatus.getResponses(); List<ExchangeSession.Event> events = session.searchEvents("/users/" + session.getEmail() + "/calendar/", ExchangeSession.getZuluDateFormat().format(start), ExchangeSession.getZuluDateFormat().format(end) ); assertEquals(events.size(), responses.length); }
Example 6
Source File: SyncMethod.java From openmeetings with Apache License 2.0 | 4 votes |
/** * Implements the Report Method. */ @Override public String getMethod() { return DavMethods.METHOD_REPORT; }