tracker.closeSession(file, getUser());
}
@RequiresLogin
public void listopen() throws IOException {
FileSystem filesys = getFilesystem();
SessionTracker tracker = getSessionTracker();
List<EditSession> sessions = tracker.getSessions(getUser());
JSONObject data = new JSONObject();
// determine the "project" for the open file and sort by it based on the file name
for (EditSession session : sessions) {
java.io.File file = session.getFile();
List<String> pathnames = new ArrayList<String>();
java.io.File temp = file;
while (!temp.equals(filesys.getUserHome(getUser()))) {
pathnames.add(temp.getName());
temp = temp.getParentFile();
if (temp == null) break;
}
// only deal with the file if it is in the user's home directory; if it's not, ignore it for now
if (temp.equals(filesys.getUserHome(getUser()))) {
Collections.reverse(pathnames);
String project = pathnames.remove(0);
JSONObject projectDict = (JSONObject) data.get(project);
if (projectDict == null) {
projectDict = new JSONObject();