resource = new WebdavResource(url);
resource.setDebug(Constant.DEBUG_LEVEL);
/* Create task (XML request) */
Hashtable<Object, String> props = new Hashtable<Object, String>();
props.put(new PropertyName(namespace.get("a"), "contentclass"),
"urn:content-classes:task");
props.put(new PropertyName(namespace.get("h"),
"outlookmessageclass"), "IPM.Task");
props.put(new PropertyName(namespace.get("d"), "subject"),
"TestTask");
props.put(new PropertyName(namespace.get("d"), "importance"),
"High");
props.put(new PropertyName(namespace.get("e"), "textdescription"),
"This is spam Task. Please delete this task.");
// Priority : 0 = Low ; 1 = Normal ; 2 = High
props.put(new PropertyName(namespace.get("h"), "x-priority-long"),
"1");
props.put(new PropertyName(namespace.get("m"), "dtdue"), dateFormat
.format(new Date()));
props.put(new PropertyName(namespace.get("m"), "dtstart"),
dateFormat.format(new Date()));
props.put(new PropertyName(namespace.get("m"), "percentcomplete"),
"0.5");
// Status : 0 = Not Started ; 1 = In Progress ; 2 = Completed ;
// 3 = Waiting on someone else ; 4 = Deferred
props.put(new PropertyName(namespace.get("m"), "status"), "2");
props.put(new PropertyName(namespace.get("g"), "reminderset"), "1");
props.put(new PropertyName(namespace.get("g"), "remindertime"),
dateFormat.format(new Date()));
/* Send webdav request and read response... */
if (resource.proppatchMethod(Constant.DAV_URL + "Tasks/Test_"
+ idDateFormat.format(new Date()) + ".EML", props, true)) {