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

Caldav: Bug 2898469 do not UrlEncode draft url twice to avoid 404 not found on send event message

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@837 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-11-16 15:24:54 +00:00
parent 34ad47a850
commit 209adc2b5d

View File

@ -2191,7 +2191,7 @@ public class ExchangeSession {
* @throws IOException on error * @throws IOException on error
*/ */
public int sendEvent(String icsBody) throws IOException { public int sendEvent(String icsBody) throws IOException {
String messageUrl = URIUtil.encodePathQuery(draftsUrl + '/' + UUID.randomUUID().toString() + ".EML"); String messageUrl = draftsUrl + '/' + UUID.randomUUID().toString() + ".EML";
int status = internalCreateOrUpdateEvent(messageUrl, "urn:content-classes:calendarmessage", icsBody, null, null).status; int status = internalCreateOrUpdateEvent(messageUrl, "urn:content-classes:calendarmessage", icsBody, null, null).status;
if (status != HttpStatus.SC_CREATED) { if (status != HttpStatus.SC_CREATED) {
return status; return status;
@ -2217,7 +2217,7 @@ public class ExchangeSession {
* @throws IOException on error * @throws IOException on error
*/ */
public EventResult createOrUpdateEvent(String folderPath, String eventName, String icsBody, String etag, String noneMatch) throws IOException { public EventResult createOrUpdateEvent(String folderPath, String eventName, String icsBody, String etag, String noneMatch) throws IOException {
String messageUrl = URIUtil.encodePath(folderPath + '/' + eventName); String messageUrl = folderPath + '/' + eventName;
return internalCreateOrUpdateEvent(messageUrl, "urn:content-classes:appointment", icsBody, etag, noneMatch); return internalCreateOrUpdateEvent(messageUrl, "urn:content-classes:appointment", icsBody, etag, noneMatch);
} }
@ -2337,7 +2337,7 @@ public class ExchangeSession {
ByteArrayOutputStream baos = new ByteArrayOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream();
OutputStreamWriter writer = new OutputStreamWriter(baos, "ASCII"); OutputStreamWriter writer = new OutputStreamWriter(baos, "ASCII");
int status = 0; int status = 0;
PutMethod putmethod = new PutMethod(messageUrl); PutMethod putmethod = new PutMethod(URIUtil.encodePath(messageUrl));
putmethod.setRequestHeader("Translate", "f"); putmethod.setRequestHeader("Translate", "f");
putmethod.setRequestHeader("Overwrite", "f"); putmethod.setRequestHeader("Overwrite", "f");
if (etag != null) { if (etag != null) {