Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)

121563 jkaabimofrad: RA-640: Fixed encoding issue when updating binary content, as well as, multipart uploading.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@126412 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jamal Kaabi-Mofrad
2016-05-10 10:49:57 +00:00
parent 9bcca7763d
commit ca1de05fe7
4 changed files with 155 additions and 71 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2014 Alfresco Software Limited.
* Copyright (C) 2005-2016 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -880,8 +880,8 @@ public class PublicApiHttpClient
public BinaryRequestEntity(File file, String mimeType, String charset)
{
this.file = file;
this.mimeType = (mimeType == null) ? "application/octet-stream" : mimeType;
this.charset = (charset == null) ? "UTF-8" : charset;
this.mimeType = mimeType;
this.charset = charset;
}
@Override
@@ -918,7 +918,15 @@ public class PublicApiHttpClient
@Override
public String getContentType()
{
return mimeType + "; " + charset;
if (charset == null)
{
return mimeType;
}
if (mimeType == null)
{
return null;
}
return mimeType + "; charset=" + charset;
}
}