mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-13 03:02:22 -05:00
Carddav: encode contact picture url
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1248 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
a2ddfeb643
commit
7b29cb2e1e
@ -648,13 +648,13 @@ public class DavExchangeSession extends ExchangeSession {
|
||||
}
|
||||
itemResult.status = status;
|
||||
|
||||
String contactPictureUrl = getHref() + "/ContactPicture.jpg";
|
||||
String contactPictureUrl = URIUtil.encodePath(getHref() + "/ContactPicture.jpg");
|
||||
String photo = get("photo");
|
||||
if (photo != null) {
|
||||
// need to update photo
|
||||
byte[] resizedImageBytes = IOUtil.resizeImage(Base64.decodeBase64(photo.getBytes()), 90);
|
||||
|
||||
final PutMethod putmethod = new PutMethod(URIUtil.encodePath(contactPictureUrl));
|
||||
final PutMethod putmethod = new PutMethod(contactPictureUrl);
|
||||
putmethod.setRequestHeader("Overwrite", "t");
|
||||
putmethod.setRequestHeader("Content-Type", "image/jpeg");
|
||||
putmethod.setRequestEntity(new ByteArrayRequestEntity(resizedImageBytes, "image/jpeg"));
|
||||
|
Loading…
Reference in New Issue
Block a user