protected Folder getFolder(ExchangeService service) { Folder folder; if(folderName.equals("INBOX")){ try { folder = Folder.bind(service, WellKnownFolderName.Inbox); } catch (Exception e) { throw new ProcessException("Failed to bind Inbox Folder on EWS Server", e); } } else { FolderView view = new FolderView(10); view.setTraversal(FolderTraversal.Deep); SearchFilter searchFilter = new SearchFilter.IsEqualTo(FolderSchema.DisplayName, folderName); try { FindFoldersResults foldersResults = service.findFolders(WellKnownFolderName.Root,searchFilter, view); ArrayList<Folder> folderIds = foldersResults.getFolders(); if(folderIds.size() > 1){ throw new ProcessException("More than 1 folder found with the name " + folderName); } folder = Folder.bind(service, folderIds.get(0).getId()); } catch (Exception e) { throw new ProcessException("Search for Inbox Subfolder failed.", e); } } return folder; }
public Object createServiceObjectWithServiceParam( ExchangeService srv) throws Exception { return new Folder(srv); } }, null);
/** * True if property was removed. * * @return Extended property collection. * @throws Exception the exception */ @Override protected ExtendedPropertyCollection getExtendedProperties() throws Exception { return this.getExtendedPropertiesForService(); }
/** * Writes the Id encapsulated in the wrapper to XML. * * @param writer the writer * @throws Exception the exception */ protected void writeToXml(EwsServiceXmlWriter writer) throws Exception { this.folder.getId().writeToXml(writer); } }
public Object createServiceObjectWithServiceParam( ExchangeService srv) throws Exception { return new CalendarFolder(srv); } }, null);
/** * Validates this instance. * * @throws Exception the exception */ @Override public void validate() throws Exception { super.validate(); if (this.getSearchParameters() != null) { this.getSearchParameters().validate(); } }
/** * Sets the display name of the folder. * * @param value Name of the folder * @throws Exception the exception */ public void setDisplayName(String value) throws Exception { this.getPropertyBag().setObjectFromPropertyDefinition( FolderSchema.DisplayName, value); }
public Object createServiceObjectWithServiceParam( ExchangeService srv) throws Exception { return new ContactsFolder(srv); } }, null);
public Object createServiceObjectWithServiceParam( ExchangeService srv) throws Exception { return new TasksFolder(srv); } }, null);
/** * Deletes the folder. Calling this method results in a call to EWS. * * @param deleteMode the delete mode * @throws Exception the exception */ public void delete(DeleteMode deleteMode) throws Exception { this.internalDelete(deleteMode, null, null); }
public Object createServiceObjectWithServiceParam( ExchangeService srv) throws Exception { return new SearchFolder(srv); } }, null);
/** * Gets the search parameters associated with the search folder. * * @return the search parameters * @throws Exception the exception */ public SearchFolderParameters getSearchParameters() throws Exception { return getPropertyBag().getObjectFromPropertyDefinition( SearchFolderSchema.SearchParameters); }
/** * Clears the change log of the updated folder if the update succeeded. */ @Override protected void loaded() { if (this.getResult() == ServiceResult.Success) { this.folder.clearChangeLog(); } }
/** * Saves this folder in a specific folder. Calling this method results in a * call to EWS. * * @param parentFolderName The name of the folder in which to save this folder. * @throws Exception the exception */ public void save(WellKnownFolderName parentFolderName) throws Exception { this.save(new FolderId(parentFolderName)); }
/** * Initializes a new instance of FolderWrapper. * * @param folder the folder * @throws ServiceLocalException the service local exception */ protected FolderWrapper(Folder folder) throws ServiceLocalException { EwsUtilities.ewsAssert(folder != null, "FolderWrapper.ctor", "folder is null"); EwsUtilities.ewsAssert(!folder.isNew(), "FolderWrapper.ctor", "folder does not have an Id"); this.folder = folder; }
FindItemsResults<Item> findResults = service.findItems(folder.getId(), sf, view);
/** * Gets the Email Lifecycle Management (ELC) information associated with the * folder. * * @return the managed folder information * @throws ServiceLocalException the service local exception */ public ManagedFolderInformation getManagedFolderInformation() throws ServiceLocalException { return getPropertyBag().getObjectFromPropertyDefinition( FolderSchema.ManagedFolderInformation); }
/** * Gets the display name of the folder. * * @return the display name * @throws ServiceLocalException the service local exception */ public String getDisplayName() throws ServiceLocalException { return getPropertyBag().getObjectFromPropertyDefinition( FolderSchema.DisplayName); }
/** * Gets the custom class name of this folder. * * @return the folder class * @throws ServiceLocalException the service local exception */ public String getFolderClass() throws ServiceLocalException { return getPropertyBag().getObjectFromPropertyDefinition( FolderSchema.FolderClass); }
/** * Gets a value indicating the effective rights the current authenticated * user has on the folder. * * @return the effective rights * @throws ServiceLocalException the service local exception */ public EnumSet<EffectiveRights> getEffectiveRights() throws ServiceLocalException { return getPropertyBag().getObjectFromPropertyDefinition( FolderSchema.EffectiveRights); }