- if (session.nodeExists(SlcJcrResultUtils
- .getMyResultsBasePath(session)))
- return session.getNode(getMyResultsBasePath(session));
- else
- return createResultFolderNode(session,
- getMyResultsBasePath(session));
+ String absPath = getMyResultsBasePath(session);
+ if (session.nodeExists(absPath)) {
+ Node currNode = session.getNode(absPath);
+ if (currNode.isNodeType(NodeType.NT_UNSTRUCTURED))
+ return currNode;
+ else
+ throw new SlcException(
+ "A node already exists at this path : " + absPath
+ + " that has the wrong type. ");
+ } else {
+ Node myResParNode = JcrUtils.mkdirs(session, absPath);
+ myResParNode.setPrimaryType(NodeType.NT_UNSTRUCTURED);
+ session.save();
+ return myResParNode;
+ }