ALF-16257: CIFS: Collaborator/editor could not edit file on Mac Os Mountain Lion

For DoubleRenameShuffle scenario for Mac Lion files add moveAsSystem flag to allow Editor to edit files. Add unit tests.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@55130 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Pavel Yurke
2013-09-09 12:41:13 +00:00
parent a1fefd64ef
commit 338ededcb8
10 changed files with 561 additions and 55 deletions

View File

@@ -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)
{