2

I have created a public calendar folder, but none of the users see it. It should be shared with others.

This is my code:

FolderView fv = new FolderView(50);
fv.setTraversal(FolderTraversal.Deep);
FindFoldersResults f = service.findFolders(WellKnownFolderName.PublicFoldersRoot, fv);

The problem is it throws java.lang.NullPointerException and

microsoft.exchange.webservices.data.EWSHttpException: Connection not established

When I change it to WellKnownFolderName.Root or any other constant like Calendar or Inbox it is working fine. I can review contents with Outlook though.

How can I access public calendar folder with Java if I don't see it and don't know the ID as well?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
Marcis
  • 71
  • 6
  • Did you ever find an answer to this? – Halvard Aug 14 '13 at 09:57
  • There is a working example here: [http://stackoverflow.com/questions/30594319/office365-api-admin-accessing-another-users-rooms-calendar-events/39040613#39040613](http://stackoverflow.com/questions/30594319/office365-api-admin-accessing-another-users-rooms-calendar-events/39040613#39040613) – Twelve24 Aug 19 '16 at 14:52
  • Post is quite old but Have you got the solution to this? I am encountering to same case. Not able to list out folders in public folders. – yatinbc Apr 06 '17 at 10:04

2 Answers2

1

If you know the email address of the person / resource with the shared folder, then this might work

//Create a inclusive view
FolderView fv = new FolderView(100);
fv.setTraversal(FolderTraversal.Deep);

//Find ID of parent calendar
FolderId sharedFolderId = new FolderId(WellKnownFolderName.Calendar, new Mailbox("email.address@of-thing-sharing-calendar"));

//Find children of that calendar
FindFoldersResults findResults = service.findFolders(sharedFolderId, fv);
wmarbut
  • 4,595
  • 7
  • 42
  • 72
  • it raises an exception microsoft.exchange.webservices.data.core.exception.service.remote.ServiceResponseException: It is not valid to specify a mailbox with the public folder root. – yatinbc Apr 13 '17 at 09:59
0

There is a working example here: Can't connect to (EWS) Public Calendar Folder Java It contains a sample java class that should compile and run, using the Java EWS API

Community
  • 1
  • 1
Twelve24
  • 637
  • 7
  • 15