/** * Returns a copy of the list of edits for a given file * * @param path * @return */ private List<JSONObject> getEdits(String path) throws IOException { // first get the file handle java.io.File file = getFilesystem().getFileHandle(getUser(), path); // get the edit session EditSession editSession = getSessionTracker().getSession(file, getUser()); if (editSession != null) { return editSession.getEdits(); } else { return new ArrayList<JSONObject>(); } }
private void addEdits(String path, JSONObject... edits) throws IOException { // first get the file handle java.io.File file = getFilesystem().getFileHandle(getUser(), path); // get the edit session EditSession editSession = getSessionTracker().getSession(file, getUser()); if (editSession == null) { getCtx().getResp().sendError(400, "No edit session open for file"); return; } editSession.addEdits(edits); }