SailLoader { public synchronized void load(final File fileOrDirectory) throws Exception { LOGGER.info("loading from " + fileOrDirectory); SailConnection c = sail.getConnection(); try { c.begin(); long startTime = System.currentTimeMillis(); long count = loadFile(fileOrDirectory, c); c.commit(); long endTime = System.currentTimeMillis(); LOGGER.info("loaded " + count + " statements in " + (endTime - startTime) + "ms"); } finally { c.rollback(); c.close(); } } SailLoader(final Sail sail); void setBaseUri(final String baseUri); void setVerbose(final boolean verbose); void setBufferSize(final int bufferSize); void setLoggingBufferSize(final int loggingBufferSize); synchronized void load(final File fileOrDirectory);  }
@Test public void testAll() throws Exception { KeyIndexableGraph g = new TinkerGraph(); Sail sail = new GraphSail(g); sail.initialize(); try { SailLoader loader = new SailLoader(sail); File f = resourceToFile("graph-example-sail-test.trig"); SailConnection sc = sail.getConnection(); try { sc.begin(); assertEquals(0, sc.size()); loader.load(f); sc.rollback(); assertEquals(29, sc.size()); } finally { sc.close(); } } finally { sail.shutDown(); } }