*/
package org.argeo.cms.ui.jcr.model;
+import javax.jcr.AccessDeniedException;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.RepositoryException;
else
return null;
} catch (RepositoryException e) {
- throw new EclipseUiException("Cannot get root node of workspace "
- + getName(), e);
+ throw new EclipseUiException("Cannot get root node of workspace " + getName(), e);
}
}
try {
session = ((RepositoryElem) getParent()).repositoryLogin(getName());
} catch (RepositoryException e) {
- throw new EclipseUiException("Cannot connect to repository "
- + getName(), e);
+ throw new EclipseUiException("Cannot connect to repository " + getName(), e);
}
}
public synchronized boolean hasChildren() {
try {
if (isConnected())
- return session.getRootNode().hasNodes();
+ try {
+ return session.getRootNode().hasNodes();
+ } catch (AccessDeniedException e) {
+ // current user may not have access to the root node
+ return false;
+ }
else
return false;
} catch (RepositoryException re) {
- throw new EclipseUiException(
- "Unexpected error while checking children node existence",
- re);
+ throw new EclipseUiException("Unexpected error while checking children node existence", re);
}
}
}
return super.getChildren();
} catch (RepositoryException e) {
- throw new EclipseUiException(
- "Cannot initialize WorkspaceNode UI object."
- + getName(), e);
+ throw new EclipseUiException("Cannot initialize WorkspaceNode UI object." + getName(), e);
}
}
}