/** * Binds to an existing search folder and loads the specified set of * property. Calling this method results in a call to EWS. * * @param service the service * @param id the id * @param propertySet the property set * @return A SearchFolder instance representing the search folder * corresponding to the specified Id. * @throws Exception the exception */ public static SearchFolder bind(ExchangeService service, FolderId id, PropertySet propertySet) throws Exception { return service.bindToFolder(SearchFolder.class, id, propertySet); }
/** * Binds to an existing calendar folder and loads the specified set of * property. Calling this method results in a call to EWS. * * @param service the service * @param id the id * @param propertySet the property set * @return A CalendarFolder instance representing the calendar folder * corresponding to the specified Id * @throws Exception the exception */ public static CalendarFolder bind(ExchangeService service, FolderId id, PropertySet propertySet) throws Exception { return service.bindToFolder(CalendarFolder.class, id, propertySet); }
/** * Binds to an existing contacts folder and loads the specified set of * property. * * @param service the service * @param id the id * @param propertySet the property set * @return A ContactsFolder instance representing the contacts folder * corresponding to the specified Id. * @throws Exception the exception */ public static ContactsFolder bind(ExchangeService service, FolderId id, PropertySet propertySet) throws Exception { return service.bindToFolder(ContactsFolder.class, id, propertySet); }
/** * Binds to an existing tasks folder and loads the specified set of * property. Calling this method results in a call to EWS. * * @param service the service * @param id the id * @param propertySet the property set * @return A TasksFolder instance representing the task folder corresponding * to the specified Id. * @throws Exception the exception */ public static TasksFolder bind(ExchangeService service, FolderId id, PropertySet propertySet) throws Exception { return service.bindToFolder(TasksFolder.class, id, propertySet); }
/** * Binds to an existing folder, whatever its actual type is, and loads the * specified set of property. Calling this method results in a call to * EWS. * * @param service The service to use to bind to the folder. * @param id The Id of the folder to bind to. * @param propertySet The set of property to load. * @return A Folder instance representing the folder corresponding to the * specified Id. * @throws Exception the exception */ public static Folder bind(ExchangeService service, FolderId id, PropertySet propertySet) throws Exception { return service.bindToFolder(Folder.class, id, propertySet); }
/** * Binds to folder. * * @param <TFolder> The type of the folder. * @param cls Folder class * @param folderId The folder id. * @param propertySet The property set. * @return Folder * @throws Exception the exception */ public <TFolder extends Folder> TFolder bindToFolder(Class<TFolder> cls, FolderId folderId, PropertySet propertySet) throws Exception { Folder result = this.bindToFolder(folderId, propertySet); if (cls.isAssignableFrom(result.getClass())) { return (TFolder) result; } else { throw new ServiceLocalException(String.format( "The folder type returned by the service (%s) isn't compatible with the requested folder type (%s).", result.getClass().getName(), cls.getName())); } }
/** * Binds to an existing search folder and loads the specified set of * property. Calling this method results in a call to EWS. * * @param service the service * @param id the id * @param propertySet the property set * @return A SearchFolder instance representing the search folder * corresponding to the specified Id. * @throws Exception the exception */ public static SearchFolder bind(ExchangeService service, FolderId id, PropertySet propertySet) throws Exception { return service.bindToFolder(SearchFolder.class, id, propertySet); }
/** * Binds to an existing tasks folder and loads the specified set of * property. Calling this method results in a call to EWS. * * @param service the service * @param id the id * @param propertySet the property set * @return A TasksFolder instance representing the task folder corresponding * to the specified Id. * @throws Exception the exception */ public static TasksFolder bind(ExchangeService service, FolderId id, PropertySet propertySet) throws Exception { return service.bindToFolder(TasksFolder.class, id, propertySet); }
/** * Binds to an existing contacts folder and loads the specified set of * property. * * @param service the service * @param id the id * @param propertySet the property set * @return A ContactsFolder instance representing the contacts folder * corresponding to the specified Id. * @throws Exception the exception */ public static ContactsFolder bind(ExchangeService service, FolderId id, PropertySet propertySet) throws Exception { return service.bindToFolder(ContactsFolder.class, id, propertySet); }
/** * Binds to an existing calendar folder and loads the specified set of * property. Calling this method results in a call to EWS. * * @param service the service * @param id the id * @param propertySet the property set * @return A CalendarFolder instance representing the calendar folder * corresponding to the specified Id * @throws Exception the exception */ public static CalendarFolder bind(ExchangeService service, FolderId id, PropertySet propertySet) throws Exception { return service.bindToFolder(CalendarFolder.class, id, propertySet); }
/** * Binds to an existing folder, whatever its actual type is, and loads the * specified set of property. Calling this method results in a call to * EWS. * * @param service The service to use to bind to the folder. * @param id The Id of the folder to bind to. * @param propertySet The set of property to load. * @return A Folder instance representing the folder corresponding to the * specified Id. * @throws Exception the exception */ public static Folder bind(ExchangeService service, FolderId id, PropertySet propertySet) throws Exception { return service.bindToFolder(Folder.class, id, propertySet); }
/** * Binds to folder. * * @param <TFolder> The type of the folder. * @param cls Folder class * @param folderId The folder id. * @param propertySet The property set. * @return Folder * @throws Exception the exception */ public <TFolder extends Folder> TFolder bindToFolder(Class<TFolder> cls, FolderId folderId, PropertySet propertySet) throws Exception { Folder result = this.bindToFolder(folderId, propertySet); if (cls.isAssignableFrom(result.getClass())) { return (TFolder) result; } else { throw new ServiceLocalException(String.format( "The folder type returned by the service (%s) isn't compatible with the requested folder type (%s).", result.getClass().getName(), cls.getName())); } }