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

87701: Merged V4.2-BUG-FIX (4.2.4) to HEAD-BUG-FIX (5.0/Cloud)
      86502: Merged DEV to V4.2-BUG-FIX (4.2.4)
         86291: MNT-12303 : Renaming a folder containing a document that is locked due to online editing causes a duplicate folder and file with no content to be created
            - Refresh lock request should not create new empty resource.
            - Unit test added.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@94540 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-01-31 09:47:13 +00:00
parent f36c9c0c4d
commit e1370e02cd
2 changed files with 61 additions and 1 deletions

View File

@@ -261,6 +261,26 @@ public class LockMethod extends WebDAVMethod
}
catch (FileNotFoundException e)
{
if (m_conditions != null)
{
// MNT-12303 fix, check whether this is a refresh lock request
for (Condition condition : m_conditions)
{
List<String> lockTolensMatch = condition.getLockTokensMatch();
List<String> etagsMatch = condition.getETagsMatch();
if (m_request.getContentLength() == -1 &&
(lockTolensMatch != null && !lockTolensMatch.isEmpty()) ||
(etagsMatch != null && !etagsMatch.isEmpty()))
{
// LOCK method with If header and without body was sent, according to RFC 2518 section 7.8
// this form of LOCK MUST only be used to "refresh" a lock. However resource doesn't exist ->
// so there is nothing to refresh. Return 403 Forbidden as original SharePoint Server.
throw new WebDAVServerException(HttpServletResponse.SC_FORBIDDEN);
}
}
}
// need to create it
String[] splitPath = getDAVHelper().splitPath(path);
// check