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/BRANCHES/DEV/V4.2-BUG-FIX/root@57947 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2013-11-17 08:15:00 +00:00
parent 95197399cd
commit 307fa68b1c

View File

@@ -221,6 +221,17 @@ public class MoveMethod extends HierarchicalMethod
// If this is a copy then the source is just copied to destination. // If this is a copy then the source is just copied to destination.
else if (!isMove) 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); 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 // 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 // It is a simple rename operation
try 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); fileFolderService.rename(sourceNodeRef, name);
// As per the WebDAV spec, we make sure the node is unlocked once moved // As per the WebDAV spec, we make sure the node is unlocked once moved
getDAVHelper().getLockService().unlock(sourceNodeRef); getDAVHelper().getLockService().unlock(sourceNodeRef);
@@ -260,6 +282,17 @@ public class MoveMethod extends HierarchicalMethod
else else
{ {
// It is a simple move operation // 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); fileFolderService.moveFrom(sourceNodeRef, sourceParentNodeRef, destParentNodeRef, name);
// As per the WebDAV spec, we make sure the node is unlocked once moved // As per the WebDAV spec, we make sure the node is unlocked once moved