protected String checkPointName(File name) { String path = name.getPath(); int pos = path.lastIndexOf(File.separatorChar); String start = path.substring(0, pos + 1); String finish = path.substring(pos + 1); return start + "checkPoint-" + finish; }
@Override public void begin() { if (inTransaction) throw new JenaException("nested transactions not supported"); else { checkPointFile = new File(checkPointName(fileGraph.name)); checkPointFile.deleteOnExit(); fileGraph.saveContents(checkPointFile); inTransaction = true; } }
@Override public void commit() { fileGraph.saveContents(fileGraph.name); checkPointFile.delete(); inTransaction = false; }