diff --git a/config/alfresco/subsystems/fileServers/default/network-protocol-context.xml b/config/alfresco/subsystems/fileServers/default/network-protocol-context.xml
index 4782c8cc03..c55c67a3db 100644
--- a/config/alfresco/subsystems/fileServers/default/network-protocol-context.xml
+++ b/config/alfresco/subsystems/fileServers/default/network-protocol-context.xml
@@ -269,6 +269,7 @@
20000
MEDIUM
true
+ .*\\.TemporaryItems.*\\Word Work File.*\.tmp
@@ -277,6 +278,7 @@
20000
MEDIUM
false
+ .*\\.TemporaryItems.*\\Word Work File.*\.tmp
@@ -284,6 +286,7 @@
20000
MEDIUM
false
+ true
diff --git a/source/java/org/alfresco/filesys/alfresco/RepositoryDiskInterface.java b/source/java/org/alfresco/filesys/alfresco/RepositoryDiskInterface.java
index f4cf9f89d4..c0c8df770a 100644
--- a/source/java/org/alfresco/filesys/alfresco/RepositoryDiskInterface.java
+++ b/source/java/org/alfresco/filesys/alfresco/RepositoryDiskInterface.java
@@ -134,7 +134,7 @@ public interface RepositoryDiskInterface
* @param newName java.lang.String
* @exception java.io.IOException The exception description.
*/
- public void renameFile(NodeRef rootNode, String oldName, String newName, boolean soft)
+ public void renameFile(NodeRef rootNode, String oldName, String newName, boolean soft, boolean moveAsSystem)
throws java.io.IOException;
diff --git a/source/java/org/alfresco/filesys/repo/ClientHelper.java b/source/java/org/alfresco/filesys/repo/ClientHelper.java
new file mode 100644
index 0000000000..0070e6b317
--- /dev/null
+++ b/source/java/org/alfresco/filesys/repo/ClientHelper.java
@@ -0,0 +1,28 @@
+package org.alfresco.filesys.repo;
+
+import org.alfresco.jlan.server.SrvSession;
+import org.alfresco.util.FileFilterMode.Client;
+
+public class ClientHelper
+{
+ public static Client getClient(SrvSession srvSession)
+ {
+ String clientStr = srvSession.getServer().getProtocolName().toLowerCase();
+ if(clientStr.equals("cifs"))
+ {
+ return Client.cifs;
+ }
+ else if(clientStr.equals("nfs"))
+ {
+ return Client.nfs;
+ }
+ else if(clientStr.equals("ftp"))
+ {
+ return Client.ftp;
+ }
+ else
+ {
+ return null;
+ }
+ }
+}
diff --git a/source/java/org/alfresco/filesys/repo/CommandExecutorImpl.java b/source/java/org/alfresco/filesys/repo/CommandExecutorImpl.java
index 12319d5a04..bd1e3e71ad 100644
--- a/source/java/org/alfresco/filesys/repo/CommandExecutorImpl.java
+++ b/source/java/org/alfresco/filesys/repo/CommandExecutorImpl.java
@@ -30,7 +30,6 @@ import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.FileFilterMode;
-import org.alfresco.util.FileFilterMode.Client;
import org.alfresco.util.PropertyCheck;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -159,27 +158,6 @@ public class CommandExecutorImpl implements CommandExecutor
return ret;
}
- private Client getClient(SrvSession srvSession)
- {
- String clientStr = srvSession.getServer().getProtocolName().toLowerCase();
- if(clientStr.equals("cifs"))
- {
- return Client.cifs;
- }
- else if(clientStr.equals("nfs"))
- {
- return Client.nfs;
- }
- else if(clientStr.equals("ftp"))
- {
- return Client.ftp;
- }
- else
- {
- return null;
- }
- }
-
/**
* @param sess
* @param tree
@@ -190,7 +168,7 @@ public class CommandExecutorImpl implements CommandExecutor
*/
private Object executeInternal(SrvSession sess, TreeConnection tree, Command command, Object result) throws IOException
{
- FileFilterMode.setClient(getClient(sess));
+ FileFilterMode.setClient(ClientHelper.getClient(sess));
try
{
if(command instanceof CompoundCommand)
@@ -255,13 +233,13 @@ public class CommandExecutorImpl implements CommandExecutor
logger.debug("rename command");
RenameFileCommand rename = (RenameFileCommand)command;
- repositoryDiskInterface.renameFile(rename.getRootNode(), rename.getFromPath(), rename.getToPath(), rename.isSoft());
+ repositoryDiskInterface.renameFile(rename.getRootNode(), rename.getFromPath(), rename.getToPath(), rename.isSoft(), false);
}
else if(command instanceof MoveFileCommand)
{
logger.debug("move command");
MoveFileCommand move = (MoveFileCommand)command;
- repositoryDiskInterface.renameFile(move.getRootNode(), move.getFromPath(), move.getToPath(), false);
+ repositoryDiskInterface.renameFile(move.getRootNode(), move.getFromPath(), move.getToPath(), false, move.isMoveAsSystem());
}
else if(command instanceof CopyContentCommand)
{
diff --git a/source/java/org/alfresco/filesys/repo/ContentDiskDriver2.java b/source/java/org/alfresco/filesys/repo/ContentDiskDriver2.java
index ec17e0f215..762500908d 100644
--- a/source/java/org/alfresco/filesys/repo/ContentDiskDriver2.java
+++ b/source/java/org/alfresco/filesys/repo/ContentDiskDriver2.java
@@ -1337,7 +1337,7 @@ public class ContentDiskDriver2 extends AlfrescoDiskDriver implements ExtendedD
* @param newName path/name of new file
* @exception java.io.IOException The exception description.
*/
- public void renameFile(NodeRef rootNode, final String oldName, final String newName, boolean soft)
+ public void renameFile(NodeRef rootNode, final String oldName, final String newName, boolean soft, boolean moveAsSystem)
throws IOException
{
@@ -1390,7 +1390,25 @@ public class ContentDiskDriver2 extends AlfrescoDiskDriver implements ExtendedD
}
else
{
- fileFolderService.moveFrom(nodeToMoveRef, sourceFolderRef, targetFolderRef, name);
+ if (moveAsSystem)
+ {
+ if (logger.isDebugEnabled())
+ {
+ logger.debug("Run move as System for: " + oldName);
+ }
+ AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork