private DocumentSet allDocs(DBBroker broker, DocumentSet docs) { Lock lock = db.getLock(); try { lock.acquire(Lock.READ_LOCK); Collection child; String childName; long addr; for (Iterator i = subcollections.iterator(); i.hasNext(); ) { childName = (String) i.next(); child = broker.getCollection(name + '/' + childName); if(child == null) { LOG.warn("child collection " + childName + " not found. Skipping ..."); } else if (child.permissions.validate(broker.getUser(), Permission.READ)) { child.getDocuments(broker, docs); if (child.getChildCollectionCount() > 0) child.allDocs(broker, docs); } } } catch (LockException e) { LOG.warn(e.getMessage(), e); } finally { lock.release();
public DocumentSet allDocs(DBBroker broker, DocumentSet docs, boolean recursive) { if (permissions.validate(broker.getUser(), Permission.READ)) { getDocuments(broker, docs); if (recursive) allDocs(broker, docs);
	private DocumentSet allDocs(DBBroker broker, DocumentSet docs) {		Lock lock = db.getLock();		try {			lock.acquire(Lock.READ_LOCK);			Collection child;			String childName;			long addr;			for (Iterator i = subcollections.iterator(); i.hasNext(); ) {				childName = (String) i.next();				child = broker.getCollection(name + '/' + childName);				if(child == null) {					LOG.warn("child collection " + childName + " not found. Skipping ...");				} else if (child.permissions.validate(broker.getUser(), Permission.READ)) {					child.getDocuments(broker, docs);					if (child.getChildCollectionCount() > 0)						child.allDocs(broker, docs);				}			}		} catch (LockException e) {			LOG.warn(e.getMessage(), e);		} finally {			lock.release();		}		return docs;	}