diff --git a/source/java/org/alfresco/repo/avm/AVMRepository.java b/source/java/org/alfresco/repo/avm/AVMRepository.java index 5fa339d9f0..913bc9e4f0 100644 --- a/source/java/org/alfresco/repo/avm/AVMRepository.java +++ b/source/java/org/alfresco/repo/avm/AVMRepository.java @@ -369,7 +369,7 @@ public class AVMRepository throw new AVMNotFoundException("Path not found."); } DirectoryNode srcDir = (DirectoryNode)sPath.getCurrentNode(); - AVMNode srcNode = srcDir.lookupChild(sPath, srcName, -1, true, false); + AVMNode srcNode = srcDir.lookupChild(sPath, srcName, false); if (srcNode == null) { throw new AVMNotFoundException("Not found: " + srcName); @@ -387,7 +387,7 @@ public class AVMRepository throw new AVMNotFoundException("Path not found."); } DirectoryNode dstDir = (DirectoryNode)dPath.getCurrentNode(); - AVMNode dstNode = dstDir.lookupChild(dPath, dstName, -1, true, false); + AVMNode dstNode = dstDir.lookupChild(dPath, dstName, false); if (dstNode != null) { throw new AVMExistsException("Node exists: " + dstName); diff --git a/source/java/org/alfresco/repo/avm/AVMStoreImpl.java b/source/java/org/alfresco/repo/avm/AVMStoreImpl.java index 784d7f2466..a6a4dc23c2 100644 --- a/source/java/org/alfresco/repo/avm/AVMStoreImpl.java +++ b/source/java/org/alfresco/repo/avm/AVMStoreImpl.java @@ -186,7 +186,7 @@ public class AVMStoreImpl implements AVMStore, Serializable throw new AVMNotFoundException("Path not found."); } DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode(); - if (dir.lookupChild(lPath, name, -1, true, false) != null) + if (dir.lookupChild(lPath, name, false) != null) { throw new AVMExistsException("Child exists: " + name); } @@ -223,7 +223,7 @@ public class AVMStoreImpl implements AVMStore, Serializable throw new AVMNotFoundException("Path not found."); } DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode(); - if (dir.lookupChild(lPath, name, -1, true, false) != null) + if (dir.lookupChild(lPath, name, false) != null) { throw new AVMExistsException("Child exists: " + name); } @@ -261,7 +261,7 @@ public class AVMStoreImpl implements AVMStore, Serializable throw new AVMNotFoundException("Path not found."); } DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode(); - if (dir.lookupChild(lPath, name, -1, true, false) != null) + if (dir.lookupChild(lPath, name, false) != null) { throw new AVMExistsException("Child exists: " + name); } @@ -291,7 +291,7 @@ public class AVMStoreImpl implements AVMStore, Serializable throw new AVMNotFoundException("Path not found."); } DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode(); - if (dir.lookupChild(lPath, name, -1, true, false) != null) + if (dir.lookupChild(lPath, name, false) != null) { throw new AVMExistsException("Child exists: " + name); } @@ -321,7 +321,7 @@ public class AVMStoreImpl implements AVMStore, Serializable throw new AVMNotFoundException("Path not found."); } DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode(); - if (dir.lookupChild(lPath, name, -1, true, false) != null) + if (dir.lookupChild(lPath, name, false) != null) { throw new AVMExistsException("Child exists: " + name); } @@ -479,7 +479,7 @@ public class AVMStoreImpl implements AVMStore, Serializable throw new AVMNotFoundException("Path not found."); } DirectoryNode dir = (DirectoryNode)lPath.getCurrentNode(); - if (dir.lookupChild(lPath, name, -1, true, false) == null) + if (dir.lookupChild(lPath, name, false) == null) { throw new AVMNotFoundException("Does not exist: " + name); } @@ -612,7 +612,7 @@ public class AVMStoreImpl implements AVMStore, Serializable // before the end. for (int i = 0; i < pathElements.length - 1; i++) { - AVMNode child = dir.lookupChild(result, pathElements[i], version, write, includeDeleted); + AVMNode child = dir.lookupChild(result, pathElements[i], includeDeleted); if (child == null) { return null; @@ -627,7 +627,7 @@ public class AVMStoreImpl implements AVMStore, Serializable dir = (DirectoryNode)result.getCurrentNode(); } // Now look up the last element. - AVMNode child = dir.lookupChild(result, pathElements[pathElements.length - 1], version, write, + AVMNode child = dir.lookupChild(result, pathElements[pathElements.length - 1], includeDeleted); if (child == null) { diff --git a/source/java/org/alfresco/repo/avm/DirectoryNode.java b/source/java/org/alfresco/repo/avm/DirectoryNode.java index 33bdf1cd9a..b209bfb806 100644 --- a/source/java/org/alfresco/repo/avm/DirectoryNode.java +++ b/source/java/org/alfresco/repo/avm/DirectoryNode.java @@ -46,11 +46,9 @@ public interface DirectoryNode extends AVMNode * Lookup a child node. * @param lPath The Lookup so far. * @param name The name of the child to lookup. - * @param version The version to look under. - * @param write Whether this is occuring in a write context. + * @param includeDeleted Include deleted nodes or not. */ - public AVMNode lookupChild(Lookup lPath, String name, int version, boolean write, - boolean includeDeleted); + public AVMNode lookupChild(Lookup lPath, String name, boolean includeDeleted); /** * Lookup a child node using an AVMNodeDescriptor as context. diff --git a/source/java/org/alfresco/repo/avm/LayeredDirectoryNodeImpl.java b/source/java/org/alfresco/repo/avm/LayeredDirectoryNodeImpl.java index 69d33d905c..4d23a8ea80 100644 --- a/source/java/org/alfresco/repo/avm/LayeredDirectoryNodeImpl.java +++ b/source/java/org/alfresco/repo/avm/LayeredDirectoryNodeImpl.java @@ -465,8 +465,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec * @return The child or null if not found. */ @SuppressWarnings("unchecked") - public AVMNode lookupChild(Lookup lPath, String name, int version, boolean write, - boolean includeDeleted) + public AVMNode lookupChild(Lookup lPath, String name, boolean includeDeleted) { ChildEntry entry = AVMDAOs.Instance().fChildEntryDAO.getByNameParent(name, this); if (entry != null) @@ -487,7 +486,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec if (lookup != null) { DirectoryNode dir = (DirectoryNode)lookup.getCurrentNode(); - AVMNode retVal = dir.lookupChild(lookup, name, -1, false, includeDeleted); + AVMNode retVal = dir.lookupChild(lookup, name, includeDeleted); lPath.setFinalStore(lookup.getFinalStore()); return retVal; } @@ -529,7 +528,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec if (lookup != null) { DirectoryNode dir = (DirectoryNode)lookup.getCurrentNode(); - AVMNode child = dir.lookupChild(lookup, name, -1, false, includeDeleted); + AVMNode child = dir.lookupChild(lookup, name, includeDeleted); if (child == null) { return null; @@ -563,7 +562,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec } else { - child = lookupChild(lPath, name, -1, false, false); + child = lookupChild(lPath, name, false); } AVMNode ghost = new DeletedNodeImpl(lPath.getAVMStore().getAVMRepository().issueID(), lPath.getAVMStore()); @@ -798,7 +797,7 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec throw new AVMBadArgumentException("Non primary layered directories cannot be linked."); } // Look for an existing child of that name. - AVMNode existing = lookupChild(lPath, name, -1, false, true); + AVMNode existing = lookupChild(lPath, name, true); if (existing != null) { if (existing.getType() != AVMNodeType.DELETED_NODE) diff --git a/source/java/org/alfresco/repo/avm/PlainDirectoryNodeImpl.java b/source/java/org/alfresco/repo/avm/PlainDirectoryNodeImpl.java index d1f994beac..30c5601de8 100644 --- a/source/java/org/alfresco/repo/avm/PlainDirectoryNodeImpl.java +++ b/source/java/org/alfresco/repo/avm/PlainDirectoryNodeImpl.java @@ -170,13 +170,11 @@ class PlainDirectoryNodeImpl extends DirectoryNodeImpl implements PlainDirectory * Lookup a child by name. * @param lPath The lookup path so far. * @param name The name to lookup. - * @param version The version to look under. - * @param write Whether this is in a write context. + * @param includeDeleted Whether to lookup deleted nodes. * @return The child or null. */ @SuppressWarnings("unchecked") - public AVMNode lookupChild(Lookup lPath, String name, int version, boolean write, - boolean includeDeleted) + public AVMNode lookupChild(Lookup lPath, String name, boolean includeDeleted) { ChildEntry entry = AVMDAOs.Instance().fChildEntryDAO.getByNameParent(name, this); if (entry == null ||