Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
JWebDAV for Exchange
>
Tutorial
> Get Free/Busy for group
The following example shows you how to get free/busy information for all users belongs to group1.
import com.independentsoft.webdav.exchange.DateTimeRange; import com.independentsoft.webdav.exchange.FreeBusy; import com.independentsoft.webdav.exchange.WebdavClient; import com.independentsoft.webdav.exchange.WebdavException; public class Example { public static void main(final String[] args) { try { WebdavClient client = new WebdavClient("https://myserver/exchange/emailaddress", "username", "password"); FreeBusy[] freeBusy = client.getFreeBusy("https://myserver/public", "First Administrative Group"); for (int i = 0; i < freeBusy.length; i++) { System.out.println("Mailbox = " + freeBusy[i].getUser()); DateTimeRange[] busy = freeBusy[i].getBusy(); DateTimeRange[] oof = freeBusy[i].getOutOfOffice(); DateTimeRange[] tentative = freeBusy[i].getTentative(); for (int j = 0; j < busy.length; j++) { System.out.println("Busy = " + busy[j].getStart() + " - " + busy[j].getEnd()); } for (int k = 0; k < oof.length; k++) { System.out.println("Out of office = " + oof[k].getStart() + " - " + oof[k].getEnd()); } for (int l = 0; l < tentative.length; l++) { System.out.println("Tentative = " + tentative[l].getStart() + " - " + tentative[l].getEnd()); } } } catch (WebdavException e) { e.printStackTrace(); } } }