mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user