throws EXistException, PermissionDeniedException {
DBBroker broker = null;
Collection collection = null;
try {
broker = factory.getBrokerPool().get(user);
collection = broker.openCollection(collUri, Lock.READ_LOCK);
if (collection == null)
{throw new EXistException("Collection " + collUri + " not found");}
if (!collection.getPermissionsNoLock().validate(user, Permission.READ))
{throw new PermissionDeniedException("not allowed to read collection " + collUri);}
final HashMap<XmldbURI, List<Object>> result = new HashMap<XmldbURI, List<Object>>(collection.getChildCollectionCount(broker));