try { progress = new ProgressIndicator( currentLine ); document.setMaxDepth( document.getMaxDepth() + 1 ); document.calculateTreeLevelStartPoints(); validate = false; if ( document.getDoctype() == null ) {   final DocumentTypeImpl dt = new DocumentTypeImpl( rootNode.getTagName(), null, document.getFileName() ); document.setDocumentType( dt ); } if(broker.getDatabaseType() != DBBroker.NATIVE) { broker.storeDocument( document ); broker.saveCollection( collection ); } document.setChildCount( 0 ); parser.parse( src ); broker.flush(); if ( broker.getDatabaseType() == DBBroker.DBM || broker.getDatabaseType() == DBBroker.NATIVE ) { collection.renameDocument( collection.getName() + "/__" + fileName, collection.getName() + '/' + fileName ); broker.addDocument( collection, document ); } return document; } catch ( NullPointerException npe ) { LOG.debug( "null pointer", npe ); throw new SAXException(npe); } catch ( PermissionDeniedException e ) { throw new SAXException("permission denied"); } }
try { progress = new ProgressIndicator(currentLine); document.setMaxDepth(document.getMaxDepth() + 1); document.calculateTreeLevelStartPoints(); validate = false; if (document.getDoctype() == null) {   final DocumentTypeImpl dt = new DocumentTypeImpl( rootNode.getTagName(), null, document.getFileName()); document.setDocumentType(dt); } if (broker.getDatabaseType() != DBBroker.NATIVE) { broker.storeDocument(document); broker.saveCollection(collection); } document.setChildCount(0); parser.parse(src); broker.flush(); if (broker.getDatabaseType() == DBBroker.DBM || broker.getDatabaseType() == DBBroker.NATIVE) { broker.addDocument(collection, document); } return document; } catch (NullPointerException npe) { LOG.debug("null pointer", npe); throw new SAXException(npe); } catch (PermissionDeniedException e) { throw new SAXException("permission denied"); } }
    public DocumentImpl store() throws SAXException, IOException {        LOG.debug( "storing document ..." );		try {			final InputStream is = src.getByteStream();			if( is != null )				is.reset();			else {				final Reader cs = src.getCharacterStream();				if( cs != null )					cs.reset();			}		} catch( IOException e ) {			LOG.debug("could not reset input source", e);		}        try {            progress = new ProgressIndicator( currentLine );            document.setMaxDepth( document.getMaxDepth() + 1 );            document.calculateTreeLevelStartPoints();            validate = false;            if ( document.getDoctype() == null ) {                // we don't know the doctype                // set it to the root node's tag name                final DocumentTypeImpl dt =                    new DocumentTypeImpl( rootNode.getTagName(), null, document.getFileName() );                document.setDocumentType( dt );            }            if(broker.getDatabaseType() != DBBroker.NATIVE) {                broker.storeDocument( document );                broker.saveCollection( collection );            }            document.setChildCount( 0 );            parser.parse( src );            broker.flush();            if ( broker.getDatabaseType() == DBBroker.DBM ||                broker.getDatabaseType() == DBBroker.NATIVE ) {                collection.renameDocument( collection.getName() + "/__" +                    fileName, collection.getName() + '/' + fileName );		        broker.addDocument( collection, document );            }            return document;        } catch ( NullPointerException npe ) {            LOG.debug( "null pointer", npe );            throw new SAXException(npe);        } catch ( PermissionDeniedException e ) {        	throw new SAXException("permission denied");        }    }