// Try to read as specified subject
broker = brokerPool.get(subject);
collection = broker.openCollection(xmldbUri, Lock.READ_LOCK);
// Get all documents
Iterator<DocumentImpl> documents = collection.iteratorNoLock(broker); // QQ: use 'iterator'
while (documents.hasNext()) {
documentURIs.add(documents.next().getURI());
}
} catch (PermissionDeniedException | EXistException e) {