/** * Sets the contact's picture using the specified file. * * @param fileName the new contact picture * @throws Exception the exception */ public void setContactPicture(String fileName) throws Exception { EwsUtilities.validateMethodVersion(this.getService(), ExchangeVersion.Exchange2010, "SetContactPicture"); internalRemoveContactPicture(); FileAttachment fileAttachment = getAttachments().addFileAttachment( new File(fileName).getName(), fileName); fileAttachment.setIsContactPhoto(true); }
/** * Removes the contact's picture. * * @throws Exception the exception */ public void removeContactPicture() throws Exception { EwsUtilities.validateMethodVersion(this.getService(), ExchangeVersion.Exchange2010, "RemoveContactPicture"); if (!this.getPropertyBag().isPropertyLoaded(ContactSchema.Attachments)) { throw new PropertyException("The attachment collection must be loaded."); } internalRemoveContactPicture(); }
/** * Sets the contact's picture using the specified byte array. * * @param content the new contact picture * @throws Exception the exception */ public void setContactPicture(byte[] content) throws Exception { EwsUtilities.validateMethodVersion(this.getService(), ExchangeVersion.Exchange2010, "SetContactPicture"); internalRemoveContactPicture(); FileAttachment fileAttachment = getAttachments().addFileAttachment( ContactPictureName, content); fileAttachment.setIsContactPhoto(true); }
/** * Sets the contact's picture using the specified stream. * * @param contentStream the new contact picture * @throws Exception the exception */ public void setContactPicture(InputStream contentStream) throws Exception { EwsUtilities.validateMethodVersion(this.getService(), ExchangeVersion.Exchange2010, "SetContactPicture"); internalRemoveContactPicture(); FileAttachment fileAttachment = getAttachments().addFileAttachment( ContactPictureName, contentStream); fileAttachment.setIsContactPhoto(true); }
/** * Sets the contact's picture using the specified file. * * @param fileName the new contact picture * @throws Exception the exception */ public void setContactPicture(String fileName) throws Exception { EwsUtilities.validateMethodVersion(this.getService(), ExchangeVersion.Exchange2010, "SetContactPicture"); internalRemoveContactPicture(); FileAttachment fileAttachment = getAttachments().addFileAttachment( new File(fileName).getName(), fileName); fileAttachment.setIsContactPhoto(true); }
/** * Sets the contact's picture using the specified byte array. * * @param content the new contact picture * @throws Exception the exception */ public void setContactPicture(byte[] content) throws Exception { EwsUtilities.validateMethodVersion(this.getService(), ExchangeVersion.Exchange2010, "SetContactPicture"); internalRemoveContactPicture(); FileAttachment fileAttachment = getAttachments().addFileAttachment( ContactPictureName, content); fileAttachment.setIsContactPhoto(true); }
/** * Removes the contact's picture. * * @throws Exception the exception */ public void removeContactPicture() throws Exception { EwsUtilities.validateMethodVersion(this.getService(), ExchangeVersion.Exchange2010, "RemoveContactPicture"); if (!this.getPropertyBag().isPropertyLoaded(ContactSchema.Attachments)) { throw new PropertyException("The attachment collection must be loaded."); } internalRemoveContactPicture(); }
/** * Sets the contact's picture using the specified stream. * * @param contentStream the new contact picture * @throws Exception the exception */ public void setContactPicture(InputStream contentStream) throws Exception { EwsUtilities.validateMethodVersion(this.getService(), ExchangeVersion.Exchange2010, "SetContactPicture"); internalRemoveContactPicture(); FileAttachment fileAttachment = getAttachments().addFileAttachment( ContactPictureName, contentStream); fileAttachment.setIsContactPhoto(true); }