DocumentImpl doc;
    public void storeResource( Resource resource ) throws XMLDBException {        if( !(resource instanceof LocalXMLResource) )            throw new XMLDBException( ErrorCodes.NOT_IMPLEMENTED );		LocalXMLResource res = (LocalXMLResource)resource;        String name = getPath() + '/' + res.getDocumentId();        DBBroker broker = null;        try {            broker = brokerPool.get();            broker.flush();            Parser parser = new Parser( broker, user, true );			Observer observer;			for(Iterator i = observers.iterator(); i.hasNext(); ) {				observer = (Observer)i.next();				parser.addObserver( observer );				broker.addObserver( observer );			}            LOG.debug( "storing document " + res.getDocumentId() );			DocumentImpl doc;			if(res.file != null)                doc = parser.parse( collection, (File)res.file, name );			else				doc = parser.parse( collection, res.content, name);            broker.flush();        } catch ( Exception e ) {            e.printStackTrace();            throw new XMLDBException( ErrorCodes.VENDOR_ERROR,                e.getMessage() );        } finally {            brokerPool.release( broker );        }    }