code: protected Node makeNodeAvailable(@Nonnull final Session session,
                                       @Nonnull final String path, @Nonnull final String primaryType)
              throws RepositoryException {
          Node node;
          try {
              node = session.getNode(StringUtils.isNotBlank(path) ? path : "/");
          } catch (PathNotFoundException nf) {
              LOG.info("createNode({},{})", path, primaryType);
              Node parent = makeNodeAvailable(session, StringUtils.substringBeforeLast(path, "/"), primaryType);
              node = parent.addNode(StringUtils.substringAfterLast(path, "/"), primaryType);
          } catch (RepositoryException e) {
              LOG.error("Error in makeNodeAvailable({},{}) : {}", new Object[]{path, primaryType, e.toString()});
              throw e;
          }
          return node;
      }
docs: nodes