mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Introduces a new variant on the link() call that makes the update() call
way faster in the worst case, i.e. tolerable so far. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3808 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1262,4 +1262,27 @@ public class AVMRepository
|
||||
AVMStore store = getAVMStoreByName(pathParts[0]);
|
||||
store.link(pathParts[1], name, toLink);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the danger version of link. It must be called on
|
||||
* a copied and unsnapshotted directory. It blithely inserts
|
||||
* a child without checking if a child exists with a conflicting name.
|
||||
* @param parent The parent directory.
|
||||
* @param name The name to give the child.
|
||||
* @param child The child to link in.
|
||||
*/
|
||||
public void link(AVMNodeDescriptor parent, String name, AVMNodeDescriptor child)
|
||||
{
|
||||
AVMNode node = AVMContext.fgInstance.fAVMNodeDAO.getByID(parent.getId());
|
||||
if (!(node instanceof DirectoryNode))
|
||||
{
|
||||
throw new AVMWrongTypeException("Not a Directory.");
|
||||
}
|
||||
DirectoryNode dir = (DirectoryNode)node;
|
||||
if (!dir.getIsNew())
|
||||
{
|
||||
throw new AVMException("Directory has not already been copied.");
|
||||
}
|
||||
dir.link(name, child);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user