docs.addElement(doc.getFileName());
perms = doc.getPermissions(); hash = new Hashtable(4); hash.put("name", doc.getFileName()); hash.put("owner", perms.getOwner()); hash.put("group", perms.getOwnerGroup()); hash.put("permissions", new Integer(perms.getPermissions())); docs.addElement(hash);
	public Hashtable getCollectionDesc(User user, String rootCollection) throws Exception {		DBBroker broker = brokerPool.get();		try {			if (rootCollection == null)				rootCollection = "/";			Collection collection = broker.getCollection(rootCollection);			if (collection == null)				throw new EXistException("collection " + rootCollection + " not found!");			Hashtable desc = new Hashtable();			Vector docs = new Vector();			Vector collections = new Vector();			if (collection.getPermissions().validate(user, Permission.READ)) {				DocumentImpl doc;				for (Iterator i = collection.iterator(); i.hasNext();) {					doc = (DocumentImpl) i.next();					docs.addElement(doc.getFileName());				}				for (Iterator i = collection.collectionIterator(); i.hasNext();)					collections.addElement((String) i.next());			}			desc.put("collections", collections);			desc.put("documents", docs);			desc.put("name", collection.getName());			return desc;		} finally {			brokerPool.release(broker);		}	}