/** * Creates a workspace with the given name and given workspace configuration * template. * * The difference between this method and {@link #createWorkspace(String, InputSource)} * is that the later notifies the other cluster node that workspace has been created * whereas this method only creates the workspace. * * @param workspaceName name of the new workspace * @param configTemplate the workspace configuration template of the new * workspace * @throws RepositoryException if a workspace with the given name already * exists or if another error occurs * @see WorkspaceImpl#createWorkspace(String,InputSource) */ private void createWorkspaceInternal(String workspaceName, InputSource configTemplate) throws RepositoryException { synchronized (wspInfos) { if (wspInfos.containsKey(workspaceName)) { throw new RepositoryException("workspace '" + workspaceName + "' already exists."); } // create the workspace configuration WorkspaceConfig config = repConfig.createWorkspaceConfig(workspaceName, configTemplate); WorkspaceInfo info = createWorkspaceInfo(config); wspInfos.put(workspaceName, info); } }
/** * Creates a workspace with the given name and given workspace configuration * template. * * The difference between this method and {@link #createWorkspace(String, InputSource)} * is that the later notifies the other cluster node that workspace has been created * whereas this method only creates the workspace. * * @param workspaceName name of the new workspace * @param configTemplate the workspace configuration template of the new * workspace * @throws RepositoryException if a workspace with the given name already * exists or if another error occurs * @see WorkspaceImpl#createWorkspace(String,InputSource) */ private void createWorkspaceInternal(String workspaceName, InputSource configTemplate) throws RepositoryException { synchronized (wspInfos) { if (wspInfos.containsKey(workspaceName)) { throw new RepositoryException("workspace '" + workspaceName + "' already exists."); } // create the workspace configuration WorkspaceConfig config = repConfig.createWorkspaceConfig(workspaceName, configTemplate); WorkspaceInfo info = createWorkspaceInfo(config); wspInfos.put(workspaceName, info); } }
WorkspaceConfig config = repConfig.createWorkspaceConfig(workspaceName, workspaceConfigContent); WorkspaceInfo info = createWorkspaceInfo(config); wspInfos.put(workspaceName, info);
public void testCreateWorkspaceConfig() throws Exception { config.createWorkspaceConfig("test-workspace", (StringBuffer) null); File workspaces_dir = new File(DIR, "workspaces"); File workspace_dir = new File(workspaces_dir, "test-workspace"); File workspace_xml = new File(workspace_dir, "workspace.xml"); assertTrue(workspace_xml.exists()); }
public void testCreateDuplicateWorkspaceConfig() throws Exception { try { config.createWorkspaceConfig("default", (StringBuffer) null); fail("No exception thrown when creating a duplicate workspace"); } catch (ConfigurationException e) { // test passed } }
WorkspaceConfig config = repConfig.createWorkspaceConfig(workspaceName, workspaceConfigContent); WorkspaceInfo info = createWorkspaceInfo(config); wspInfos.put(workspaceName, info);
createWorkspaceConfig(defaultWorkspace, (StringBuffer)null);
createWorkspaceConfig(defaultWorkspace, (StringBuffer)null);