+ // for the time being we systematically open a session, in order to make sure
+ // that home is initialised
+ Session session = null;
+ try {
+ if (state != null && state.startsWith("/")) {
+ String path = state.substring(1);
+ String workspace;
+ if (path.equals("")) {
+ workspace = null;
+ path = "/";
+ } else {
+ int index = path.indexOf('/');
+ if (index == 0) {
+ log.error("Cannot interpret // " + state);
+ getBrowserNavigation().pushState("~", null);
+ return;
+ } else if (index > 0) {
+ workspace = path.substring(0, index);
+ path = path.substring(index);
+ } else {// index<0, assuming root node
+ workspace = path;
+ path = "/";
+ }
+ }