public RestWorkspaces getWorkspaces( HttpServletRequest request,
String repositoryName ) throws RepositoryException {
assert request != null;
assert repositoryName != null;
RestWorkspaces workspaces = new RestWorkspaces();
Session session = getSession(request, repositoryName, null);
for (String workspaceName : session.getWorkspace().getAccessibleWorkspaceNames()) {
String repositoryUrl = RestHelper.urlFrom(request);
workspaces.addWorkspace(workspaceName, repositoryUrl);
}
return workspaces;
}