mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Update can now handle source paths with incomplete corresponding destination paths.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3887 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -401,6 +401,7 @@ public class AVMSyncServiceImpl implements AVMSyncService
|
||||
*/
|
||||
private void linkIn(String parentPath, String name, AVMNodeDescriptor toLink, boolean removeFirst)
|
||||
{
|
||||
mkdirs(parentPath);
|
||||
if (removeFirst)
|
||||
{
|
||||
fAVMService.removeNode(parentPath, name);
|
||||
@@ -674,4 +675,25 @@ public class AVMSyncServiceImpl implements AVMSyncService
|
||||
fAVMService.removeNode(parts[0], parts[1]);
|
||||
fAVMService.createLayeredDirectory(desc.getIndirection(), parts[0], parts[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Make sure this entire directory path exists.
|
||||
* @param path
|
||||
*/
|
||||
private void mkdirs(String path)
|
||||
{
|
||||
if (fAVMService.lookup(-1, path) != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
String [] pathParts = AVMNodeConverter.SplitBase(path);
|
||||
if (pathParts[0] == null)
|
||||
{
|
||||
// This is a root path and as such has to exist.
|
||||
// Something else is going on.
|
||||
throw new AVMSyncException("No corresponding destination path: " + path);
|
||||
}
|
||||
mkdirs(pathParts[0]);
|
||||
fAVMService.createDirectory(pathParts[0], pathParts[1]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user