mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Checkpoint of AVMSyncService support changes. Fix of AVMNodeConverter not liking
trailing '/'s. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3803 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -29,6 +29,7 @@ import java.util.SortedMap;
|
||||
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.service.cmr.avm.AVMBadArgumentException;
|
||||
import org.alfresco.service.cmr.avm.AVMCycleException;
|
||||
import org.alfresco.service.cmr.avm.AVMException;
|
||||
import org.alfresco.service.cmr.avm.AVMExistsException;
|
||||
@@ -515,6 +516,32 @@ public class AVMRepository
|
||||
return store.getListingDirect(version, pathParts[1], includeDeleted);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of nodes directly contained in a directory.
|
||||
* @param dir The descriptor to the directory node.
|
||||
* @param includeDeleted Whether to include deleted children.
|
||||
* @return A Map of names to descriptors.
|
||||
*/
|
||||
public SortedMap<String, AVMNodeDescriptor>
|
||||
getListingDirect(AVMNodeDescriptor dir, boolean includeDeleted)
|
||||
{
|
||||
AVMNode node = AVMContext.fgInstance.fAVMNodeDAO.getByID(dir.getId());
|
||||
if (node == null)
|
||||
{
|
||||
throw new AVMBadArgumentException("Invalid Node.");
|
||||
}
|
||||
if (node.getType() == AVMNodeType.PLAIN_DIRECTORY)
|
||||
{
|
||||
return getListing(dir, includeDeleted);
|
||||
}
|
||||
if (node.getType() != AVMNodeType.LAYERED_DIRECTORY)
|
||||
{
|
||||
throw new AVMWrongTypeException("Not a directory.");
|
||||
}
|
||||
LayeredDirectoryNode dirNode = (LayeredDirectoryNode)node;
|
||||
return dirNode.getListingDirect(dir, includeDeleted);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a directory listing from a directory node descriptor.
|
||||
* @param dir The directory node descriptor.
|
||||
@@ -524,6 +551,10 @@ public class AVMRepository
|
||||
{
|
||||
fLookupCount.set(1);
|
||||
AVMNode node = AVMContext.fgInstance.fAVMNodeDAO.getByID(dir.getId());
|
||||
if (node == null)
|
||||
{
|
||||
throw new AVMBadArgumentException("Invalid Node.");
|
||||
}
|
||||
if (node.getType() != AVMNodeType.LAYERED_DIRECTORY &&
|
||||
node.getType() != AVMNodeType.PLAIN_DIRECTORY)
|
||||
{
|
||||
|
Reference in New Issue
Block a user