Merged all the AVM mapping files into one medium file. I find it easier to follow.

Purged the pointless FileContentFactory class.  If everything else were working file reading
and writing would now work.  Various other cleanups and some richer internal documentation.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@2904 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-05-16 22:55:37 +00:00
parent f9ac70712b
commit 8818e8daba
20 changed files with 408 additions and 251 deletions

View File

@@ -153,15 +153,18 @@ public abstract class AVMNode
*/
public AVMNode copyOnWrite(Lookup lPath)
{
// Call the subclass's copy on write logic.
AVMNode newMe = possiblyCopy(lPath);
String myName = lPath.getName();
lPath.upCurrentNode();
// No copying needed, so short circuit.
if (newMe == null)
{
return this;
}
Repository repos = getRepository();
String myName = lPath.getName();
lPath.upCurrentNode();
Repository repos = lPath.getRepository();
newMe.setVersion(repos.getLatestVersion() + 1);
// Get our parent directory if we have one.
DirectoryNode parent = null;
if (getParent() != null)
{
@@ -169,6 +172,7 @@ public abstract class AVMNode
}
if (parent != null)
{
// Recursive invocation.
DirectoryNode newParent =
(DirectoryNode)parent.copyOnWrite(lPath);
newParent.putChild(myName, newMe);
@@ -176,15 +180,14 @@ public abstract class AVMNode
}
else // Null parent means root of repository.
{
newMe.setRepository(getRepository());
repos.setNewRoot((DirectoryNode)newMe);
}
newMe.setRepository(repos);
newMe.setShouldBeCopied(false);
repos.setNew(newMe);
return newMe;
}
/**
* Possibly copy ourselves.
* @param lPath The Lookup for this node.