Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
JWebDAV for Exchange
>
Tutorial
> Set properties
The following example shows you how to set single property or array of properties.
import com.independentsoft.webdav.exchange.ContactPropertyName; import com.independentsoft.webdav.exchange.Property; import com.independentsoft.webdav.exchange.WebdavClient; import com.independentsoft.webdav.exchange.WebdavException; public class Example { public static void main(final String[] args) { try { WebdavClient client = new WebdavClient("https://myserver/exchange/emailaddress", "username", "password"); //Set contact's City property Property cityProperty = new Property(ContactPropertyName.CITY, "Atlanta"); client.setProperty("contactUrl", cityProperty); //Set custom property Property myProperty = new Property("property1", "independentsoft:", "value1"); client.setProperty("messageUrl", myProperty); //Set array of properties Property[] propertyArray = new Property[5]; propertyArray[0] = new Property("property1", "mynamespace:", "value1"); propertyArray[1] = new Property("property2", "mynamespace:", "value2"); propertyArray[2] = new Property("property3", "mynamespace:", "value3"); propertyArray[3] = new Property("property4", "mynamespace:", "value4"); propertyArray[4] = new Property("property5", "mynamespace:", "value5"); client.setProperty("messageUrl", propertyArray); } catch (WebdavException e) { e.printStackTrace(); } } }