/** * 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; }
/** * validates request. * * @throws ServiceLocalException the service local exception * @throws Exception the exception */ @Override protected void validate() throws ServiceLocalException, Exception { super.validate(); EwsUtilities.validateParamCollection(this.getFolders().iterator(), "Folders"); for (int i = 0; i < this.getFolders().size(); i++) { Folder folder = this.getFolders().get(i); if ((folder == null) || folder.isNew()) { throw new IllegalArgumentException(String.format("Folders[%d] is either null or does not have an Id.", i)); } folder.validate(); } }
/** * 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; }
/** * validates request. * * @throws ServiceLocalException the service local exception * @throws Exception the exception */ @Override protected void validate() throws ServiceLocalException, Exception { super.validate(); EwsUtilities.validateParamCollection(this.getFolders().iterator(), "Folders"); for (int i = 0; i < this.getFolders().size(); i++) { Folder folder = this.getFolders().get(i); if ((folder == null) || folder.isNew()) { throw new IllegalArgumentException(String.format("Folders[%d] is either null or does not have an Id.", i)); } folder.validate(); } }