/** * @param dataSource * @throws XMLDBException */ private void storeSAXEvents(XMLReader dataSource) { try { if (root instanceof LocalCollection) { long t0 = System.currentTimeMillis(); LocalCollection coll = (LocalCollection) root; coll.setReader(dataSource); String existHome = System.getProperty("exist.home"); File existDir = existHome == null ? new File(".") : new File(existHome); doc.setContent(new File(existDir, FILE_STORED)); coll.storeResource(doc); long t1 = System.currentTimeMillis(); System.out.println("Time for storing: " + (t1 - t0) + " ms."); } } catch (XMLDBException e) { fail(e.getMessage()); } }