CLOUD-2204: Merged HEAD-BUG-FIX (Cloud/4.3) to HEAD (Cloud/4.3)

57951: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3)
      57947: Merged V4.1-BUG-FIX (4.1.8) to V4.2-BUG-FIX (4.2.1)
         57945: Merged V4.1.7 (4.1.7) to V4.1-BUG-FIX (4.1.8)
            57943: MNT-9988: Merged V4.1.3 (4.1.3.18) to V4.1.7 (4.1.7)
               57885: Merged DEV to V4.1.3-PATCHES (4.1.3.18)
                  57855 : MNT-9939, MNT-9969 : CLONE - alfresco webdav does not pass litmus webdav test suite
                     - Adding OverWrite header support


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@58451 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2013-12-02 10:40:24 +00:00
parent 7f1c0c42c7
commit fa4928e6ea

View File

@@ -221,6 +221,17 @@ public class MoveMethod extends HierarchicalMethod
// If this is a copy then the source is just copied to destination.
else if (!isMove)
{
// MNT-9939 - check overwrite
if (hasOverWrite() && destFileInfo != null)
{
if (logger.isDebugEnabled())
{
logger.debug("Destination exists and overwrite is allowed");
}
fileFolderService.delete(destFileInfo.getNodeRef());
}
fileFolderService.copy(sourceNodeRef, destParentNodeRef, name);
}
// If this is a move and the destination looks like the start of a shuffle operation, then the source is just
@@ -239,6 +250,17 @@ public class MoveMethod extends HierarchicalMethod
// It is a simple rename operation
try
{
// MNT-9939 - check overwrite
if (hasOverWrite() && destFileInfo != null && !sourceFileInfo.equals(destFileInfo))
{
if (logger.isDebugEnabled())
{
logger.debug("Destination exists and overwrite is allowed");
}
fileFolderService.delete(destFileInfo.getNodeRef());
}
fileFolderService.rename(sourceNodeRef, name);
// As per the WebDAV spec, we make sure the node is unlocked once moved
getDAVHelper().getLockService().unlock(sourceNodeRef);
@@ -260,6 +282,17 @@ public class MoveMethod extends HierarchicalMethod
else
{
// It is a simple move operation
// MNT-9939 - check overwrite
if (hasOverWrite() && destFileInfo != null)
{
if (logger.isDebugEnabled())
{
logger.debug("Destination exists and overwrite is allowed");
}
fileFolderService.delete(destFileInfo.getNodeRef());
}
fileFolderService.moveFrom(sourceNodeRef, sourceParentNodeRef, destParentNodeRef, name);
// As per the WebDAV spec, we make sure the node is unlocked once moved