docs: public static Session getSession( HttpServletRequest request,
                                        String repositoryName,
                                        String workspaceName ) throws RepositoryException {
          // Go through all the RepositoryFactory instances and try to create one ...
          Repository repository = getRepository(repositoryName);
  
          // If there's no authenticated user, try an anonymous login
          if (request == null || request.getUserPrincipal() == null) {
              return repository.login(workspaceName);
          }
  
          return repository.login(new ServletCredentials(request), workspaceName);
      }