Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (4.3/Cloud)

73692: Merged V4.2-BUG-FIX (4.2.3) to HEAD-BUG-FIX (4.3/Cloud)
      73618: Merged V4.1-BUG-FIX (4.1.10) to V4.2-BUG-FIX (4.2.3)
         73617: Merged V4.1.9 (4.1.9) to V4.1-BUG-FIX (4.1.10)
            73566: MNT-11647: Impossible to check in the google spreadsheet
            Cookies handling has been disabled for spreadsheet service. It causes 'java.lang.IllegalArgumentException: Trying to set foreign cookie' due to changes in Google API


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@74807 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Will Abson
2014-06-25 16:07:53 +00:00
parent c155d62f06
commit 110275a785

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2013 Alfresco Software Limited.
* Copyright (C) 2005-2014 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -197,6 +197,18 @@ public class GoogleDocsServiceImpl extends TransactionListenerAdapter
else
{
service = new MediaService(serviceName, applicationName);
// MNT-11647: Changes in Google Docs API lead to setting 'Domain: .docs.google.com' cookie. This setting is causing the following exception:
// 'java.lang.IllegalArgumentException: Trying to set foreign cookie'. Operations with spreadsheets cannot be completed
if (serviceName.equals(spreadSheetServiceName) == true)
{
if (logger.isDebugEnabled())
{
logger.debug("Disabling handling cookies for '" + serviceName + "' Google Docs service");
}
service.setHandlesCookies(false);
}
}
service.setChunkedMediaUpload(-1);