1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 19:22:22 -05:00

IMAP: fix 3014787 remove property over WebDav

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1089 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-06-11 22:12:37 +00:00
parent 9284a924e5
commit 7b7fa90edf
2 changed files with 12 additions and 5 deletions

View File

@ -31,6 +31,7 @@ import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PutMethod;
import org.apache.commons.httpclient.util.URIUtil;
import org.apache.jackrabbit.webdav.DavConstants;
import org.apache.jackrabbit.webdav.MultiStatusResponse;
import org.apache.jackrabbit.webdav.client.methods.CopyMethod;
import org.apache.jackrabbit.webdav.client.methods.MoveMethod;
@ -495,7 +496,7 @@ public class DavExchangeSession extends ExchangeSession {
*/
public void createFolder(String folderName, String folderClass) throws IOException {
String folderPath = getFolderPath(folderName);
ArrayList<DavProperty> list = new ArrayList<DavProperty>();
ArrayList<DavConstants> list = new ArrayList<DavConstants>();
list.add(Field.createDavProperty("folderclass", folderClass));
// standard MkColMethod does not take properties, override PropPatchMethod instead
PropPatchMethod method = new PropPatchMethod(URIUtil.encodePath(folderPath), list) {
@ -634,8 +635,8 @@ public class DavExchangeSession extends ExchangeSession {
return messages;
}
protected List<DavProperty> buildProperties(Map<String, String> properties) {
ArrayList<DavProperty> list = new ArrayList<DavProperty>();
protected List<DavConstants> buildProperties(Map<String, String> properties) {
ArrayList<DavConstants> list = new ArrayList<DavConstants>();
for (Map.Entry<String, String> entry : properties.entrySet()) {
if ("read".equals(entry.getKey())) {
list.add(Field.createDavProperty("read", entry.getValue()));

View File

@ -18,6 +18,7 @@
*/
package davmail.exchange.dav;
import org.apache.jackrabbit.webdav.DavConstants;
import org.apache.jackrabbit.webdav.property.DavPropertyName;
import org.apache.jackrabbit.webdav.property.DefaultDavProperty;
import org.apache.jackrabbit.webdav.xml.Namespace;
@ -213,7 +214,12 @@ public class Field {
return new Field(SCHEMAS_MAPI_STRING_INTERNET_HEADERS, headerName);
}
public static DefaultDavProperty createDavProperty(String alias, String value) {
return new DefaultDavProperty(Field.get(alias).davPropertyName, value);
public static DavConstants createDavProperty(String alias, String value) {
if (value == null) {
// return DavPropertyName to remove property
return Field.get(alias).davPropertyName;
} else {
return new DefaultDavProperty(Field.get(alias).davPropertyName, value);
}
}
}