if(res.file != null) uri = new URI(res.file.toURL().toString()).toASCIIString();
if(res.file != null) uri = res.file.toURI().toASCIIString();
	private void storeXMLResource(LocalXMLResource res) throws XMLDBException {		DBBroker broker = null;		try {			broker = brokerPool.get(user);			String name = res.getDocumentId();			String uri = null;			if(res.file != null)				uri = new URI(res.file.toURL().toString()).toASCIIString();			DocumentImpl newDoc;			Collection collection = broker.openCollection(path, Lock.WRITE_LOCK);			IndexInfo info = null;			try {				if(collection == null)					throw new XMLDBException(ErrorCodes.INVALID_COLLECTION, "Collection " + path + " not found");				Observer observer;				for (Iterator i = observers.iterator(); i.hasNext();) {					observer = (Observer) i.next();					collection.addObserver(observer);				}				if (uri != null) {					info = collection.validate(broker, name, new InputSource(uri));				} else if (res.root != null)					info = collection.validate(broker, name, res.root);				else					info = collection.validate(broker, name, res.content);			} finally {				collection.release();			}			if (uri != null) {				collection.store(broker, info, new InputSource(uri), false);			} else if (res.root != null) {				collection.store(broker, info, res.root, false);			} else {				collection.store(broker, info, res.content, false);			}			collection.deleteObservers();		} catch (Exception e) {			e.printStackTrace();			throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e.getMessage(), e);		} finally {			brokerPool.release(broker);		}	}