/** * Forwards the method call to the underlying workspace. */ public String[] getAccessibleWorkspaceNames() throws RepositoryException { return workspace.getAccessibleWorkspaceNames(); }
@Override public String[] getAccessibleWorkspaceNames() throws RepositoryException { return delegate.getAccessibleWorkspaceNames(); }
@Override public String[] getAccessibleWorkspaceNames() throws RepositoryException { return getWrappedWorkspace().getAccessibleWorkspaceNames(); }
/** {@inheritDoc} */ public String[] getAccessibleWorkspaceNames() throws RepositoryException, RemoteException { try { return workspace.getAccessibleWorkspaceNames(); } catch (RepositoryException ex) { throw getRepositoryException(ex); } }
/** * Checks that the repository supports multiple workspace, otherwise aborts with * {@link NotExecutableException}. * @throws NotExecutableException when the repository only supports a single * workspace */ protected void ensureMultipleWorkspacesSupported() throws RepositoryException, NotExecutableException { String workspacenames[] = superuser.getWorkspace().getAccessibleWorkspaceNames(); if (workspacenames == null || workspacenames.length < 2) { throw new NotExecutableException("This repository does not seem to support multiple workspaces."); } }
public String[] execute() throws Exception { return getDelegate().getAccessibleWorkspaceNames(); } });
private void checkValidWorkspace(String workspaceName) throws RepositoryException { String[] workspaceNames = getSession().getWorkspace().getAccessibleWorkspaceNames(); if (!asList(workspaceNames).contains(workspaceName)) { throw new NoSuchWorkspaceException( "Workspace " + workspaceName + " does not exist"); } }
private void checkValidWorkspace(String workspaceName) throws RepositoryException { String[] workspaceNames = getSession().getWorkspace().getAccessibleWorkspaceNames(); if (!asList(workspaceNames).contains(workspaceName)) { throw new NoSuchWorkspaceException( "Workspace " + workspaceName + " does not exist"); } }
private void checkValidWorkspace(String workspaceName) throws RepositoryException { String[] workspaceNames = getSession().getWorkspace().getAccessibleWorkspaceNames(); if (!asList(workspaceNames).contains(workspaceName)) { throw new NoSuchWorkspaceException( "Workspace " + workspaceName + " does not exist"); } }
/** * {@inheritDoc} */ public String[] getWorkspaceNames(SessionInfo sessionInfo) throws RepositoryException { Session s = getSessionInfoImpl(sessionInfo).getSession(); return s.getWorkspace().getAccessibleWorkspaceNames(); }
/** * {@inheritDoc} */ public String[] getWorkspaceNames(SessionInfo sessionInfo) throws RepositoryException { Session s = getSessionInfoImpl(sessionInfo).getSession(); return s.getWorkspace().getAccessibleWorkspaceNames(); }
@Override public boolean exists() { try { List<String> available = Arrays.asList(getRepositorySession().getWorkspace().getAccessibleWorkspaceNames()); return available.contains(getLocator().getWorkspaceName()); } catch (RepositoryException e) { log.warn(e.getMessage()); return false; } }
private static String getNewWorkspaceName(Workspace wsp) throws RepositoryException { List<String> names = Arrays.asList(wsp.getAccessibleWorkspaceNames()); int index = 0; while (names.contains("testWsp_" + index)) { index++; } return "testWsp_" + index; }
private String getNewWorkspaceName(Workspace wsp) throws RepositoryException { List<String> awn = Arrays.asList(wsp.getAccessibleWorkspaceNames()); String workspaceName = "new"; int i = 0; while (awn.contains(workspaceName)) { workspaceName = "new_" + i++; } return workspaceName; }
public void testInvalidSrcWorkspace() throws RepositoryException { String nonExistingWorkspace = "nonExistingWorkspace"; String[] accessibleWorkspaces = testRootNode.getSession().getWorkspace().getAccessibleWorkspaceNames(); List<String> l = Arrays.asList(accessibleWorkspaces); while (l.contains(nonExistingWorkspace)) { nonExistingWorkspace = nonExistingWorkspace + "_"; } try { testRootNode.update(nonExistingWorkspace); } catch (NoSuchWorkspaceException e) { // ok } }
protected void assertAccessibleWorkspace( Session session, String workspaceName ) throws Exception { assertContains(session.getWorkspace().getAccessibleWorkspaceNames(), workspaceName); }
public void testCanAccessDeniedWorkspace() throws RepositoryException, NotExecutableException { Session s = getHelper().getReadOnlySession(); try { Set<String> allAccessibles = new HashSet<String>(Arrays.asList(superuser.getWorkspace().getAccessibleWorkspaceNames())); Set<String> sWorkspaceNames = new HashSet<String>(Arrays.asList(s.getWorkspace().getAccessibleWorkspaceNames())); if (!allAccessibles.removeAll(sWorkspaceNames) || allAccessibles.isEmpty()) { throw new NotExecutableException("No workspace name found that exists but is not accessible for ReadOnly session."); } String notAccessibleName = allAccessibles.iterator().next(); assertFalse(getAccessManager(s).canAccess(notAccessibleName)); } finally { s.logout(); } }
@Ignore("OAK-118") // TODO OAK-118: implement workspace management @Test public void getWorkspaceNames() throws RepositoryException { String[] workspaces = getAdminSession().getWorkspace().getAccessibleWorkspaceNames(); Set<String> names = new HashSet<String>() {{ add("default"); }}; assertTrue(asList(workspaces).containsAll(names)); assertTrue(names.containsAll(asList(workspaces))); }
private String getAnotherWorkspace() throws NotExecutableException, RepositoryException { String srcWorkspace = getHelper().getProperty("org.apache.jackrabbit.jcr2spi.workspace2.name");; if (srcWorkspace == null || srcWorkspace.equals(currentWorkspace)) { throw new NotExecutableException("no alternative workspace configured"); } String[] accessible = testRootNode.getSession().getWorkspace().getAccessibleWorkspaceNames(); for (int i = 0; i < accessible.length; i++) { if (accessible[i].equals(srcWorkspace)) { return srcWorkspace; } } throw new NotExecutableException("configured workspace does not exist."); } }
public void testCanAccessAllAvailable() throws RepositoryException, NotExecutableException { Session s = getHelper().getReadOnlySession(); try { String[] wspNames = s.getWorkspace().getAccessibleWorkspaceNames(); for (String wspName : wspNames) { assertTrue(getAccessManager(s).canAccess(wspName)); } } finally { s.logout(); } }