broker.checkTree(document);
	public void store(DBBroker broker, IndexInfo info, InputSource source, boolean privileged)	throws EXistException, PermissionDeniedException, TriggerException,	SAXException, LockException {		// reset the input source		try {			final InputStream is = source.getByteStream();			if (is != null)				is.reset();			else {				final Reader cs = source.getCharacterStream();				if (cs != null)					cs.reset();			}		} catch (IOException e) {			LOG.debug("could not reset input source", e);		}		// second pass: store the document		Indexer indexer = info.getIndexer();		DocumentImpl document = indexer.getDocument();		LOG.debug("storing document " + document.getDocId() + "; " + document.getFileName() + " ...");		try {			try {				info.getReader().parse(source);			} catch (IOException e) {				throw new EXistException(e);			}			if(!hasDocument(document.getFileName())) {				addDocument(broker, document);				broker.addDocument(this, document);			} else {				broker.updateDocument(document);			}			broker.closeDocument();			broker.flush();			broker.checkTree(document);			LOG.debug("document stored.");			// if we are running in privileged mode (e.g. backup/restore)			// notify the SecurityManager about changes			if (getName().equals(SecurityManager.SYSTEM) && document.getFileName().equals(SecurityManager.ACL_FILE)			        && privileged == false) {			    // inform the security manager that system data has changed			    LOG.debug("users.xml changed");			    broker.getBrokerPool().reloadSecurityManager(broker);			}		} finally {			document.getUpdateLock().release(Lock.WRITE_LOCK);		}		broker.deleteObservers();		return;	}