Java Code Examples for microsoft.exchange.webservices.data.property.complex.FileAttachment#setIsContactPhoto()
The following examples show how to use
microsoft.exchange.webservices.data.property.complex.FileAttachment#setIsContactPhoto() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Contact.java From ews-java-api with MIT License | 5 votes |
/** * 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); }
Example 2
Source File: Contact.java From ews-java-api with MIT License | 5 votes |
/** * 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); }
Example 3
Source File: Contact.java From ews-java-api with MIT License | 5 votes |
/** * 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); }