Displays node for the given repository, workspace and path.

@param repository the name of the repository.
@param workspace the name of workspace.
@param path the path to the node.
@param changeHistory store changes in browser history.
190631
public void displayContent(String repository, String workspace, String path,
            boolean changeHistory) {
        contents.show(repository, workspace, path, changeHistory);
        displayRepository(repository);
        display(contents);
        changeRepositoryInURL(repository, changeHistory);
    }
730691
protected void visitChildProperties(NodeData node) throws RepositoryException
   {
      if (isInterrupted())
         return;
      for (PropertyData data : dataManager.getChildPropertiesData(node))
      {
         if (isInterrupted())
            return;
         data.accept(this);
      }
   }
388642
public Object visit(QueryRootNode node, Object data) throws RepositoryException {
        StringBuilder sb = (StringBuilder) data;
        node.getLocationNode().accept(this, data);
        InternalQName[] selectProps = node.getSelectProperties();
        if (selectProps.length > 0) {
            sb.append('/');
            boolean union = selectProps.length > 1;
            if (union) {
                sb.append('(');
            }
            String pipe = "";
            for (int i = 0; i < selectProps.length; i++) {
                try {
                    sb.append(pipe);
                    sb.append('@');
                    sb.append(resolver.createJCRName(encode(selectProps[i])).getAsString());
                    pipe = "|";
                } catch (NamespaceException e) {
                    exceptions.add(e);
                }
            }
            if (union) {
                sb.append(')');
            }
        }
        if (node.getOrderNode() != null) {
            node.getOrderNode().accept(this, data);
        }
        return data;
    }
998930
public static void assertNodeExistByPath(final Session session, final String absPath) throws RepositoryException {
        try {
            session.getNode(absPath);
        } catch (final PathNotFoundException e) {
            LOG.debug("Node path {} does not exist", absPath, e);
            fail(e.getMessage());
        }
    }
666702
@com.fasterxml.jackson.annotation.JsonProperty("repositoryName")
    public void setRepositoryName(String repositoryName) {
        this.repositoryName = repositoryName;
    }
1159149
protected void removeWorkspace(ManageableRepository mr, String workspaceName) throws RepositoryException
   {

      boolean isExists = false;
      for (String wsName : mr.getWorkspaceNames())
         if (workspaceName.equals(wsName))
         {
            isExists = true;
            break;
         }

      if (isExists)
      {
         if (!mr.canRemoveWorkspace(workspaceName))
         {
            WorkspaceContainerFacade wc = mr.getWorkspaceContainer(workspaceName);
            SessionRegistry sessionRegistry = (SessionRegistry)wc.getComponent(SessionRegistry.class);
            sessionRegistry.closeSessions(workspaceName);
         }

         mr.removeWorkspace(workspaceName);
      }
   }
672404
private void checkSameNameSibling(NodeData node, WorkspaceStorageConnection con, final Set<QPath> addedNodes)
      throws RepositoryException
   {
      if (node.getQPath().getIndex() > 1)
      {
         // check if an older same-name sibling exists
         // the check is actual for all operations including delete

         final QPathEntry[] path = node.getQPath().getEntries();
         final QPathEntry[] siblingPath = new QPathEntry[path.length];
         final int li = path.length - 1;
         System.arraycopy(path, 0, siblingPath, 0, li);

         siblingPath[li] = new QPathEntry(path[li], path[li].getIndex() - 1);

         if (addedNodes.contains(new QPath(siblingPath)))
         {
            // current changes log has the older same-name sibling
            return;
         }
         else
         {
            // check in persistence
            if (dataContainer.isCheckSNSNewConnection())
            {
               final WorkspaceStorageConnection acon = dataContainer.openConnection();
               try
               {
                  checkPersistedSNS(node, acon);
               }
               finally
               {
                  acon.close();
               }
            }
            else
            {
               checkPersistedSNS(node, con);
            }
         }
      }
   }
240612
public void setEntityPath(java.util.Collection<FaultRootCauseEntity> entityPath) {
        if (entityPath == null) {
            this.entityPath = null;
            return;
        }

        this.entityPath = new java.util.ArrayList<FaultRootCauseEntity>(entityPath);
    }
56274
private String key(ManageableRepository repository, String workspaceName)
   {
      String repositoryName = repository.getConfiguration().getName();
      return repositoryName + workspaceName;
   }
941060
public void setWorkingDirectory(String path) {
        if (path != null) {
            File dir = new File(path);
            checkWorkingDir(dir);
            workingDir = dir;
        } else {
            workingDir = null;
        }
    }
1084304
public static void assertNodeTypeExists(final Session session, final String nodeTypeName)
            throws RepositoryException {

        final NodeTypeManager ntm = session.getWorkspace().getNodeTypeManager();
        assertTrue("NodeType " + nodeTypeName + " does not exist", ntm.hasNodeType(nodeTypeName));
    }
441210
Node getGroupNode(Session session, Group group) throws PathNotFoundException, RepositoryException
   {
      return getGroupNode(session, group == null ? "" : group.getId());
   }
262926
protected void workspaceAdded( String workspaceName ) {
        String workspaceKey = NodeKey.keyForWorkspaceName(workspaceName);
        if (systemWorkspaceKey.equals(workspaceKey)) {
            // No sequencers for the system workspace!
            return;
        }
        Collection<SequencingConfiguration> configs = new LinkedList<SequencingConfiguration>();
        // Go through the sequencers to see which apply to this workspace ...
        for (Sequencer sequencer : sequencersById.values()) {
            boolean updated = false;
            for (SequencerPathExpression expression : pathExpressionsBySequencerId.get(sequencer.getUniqueId())) {
                if (expression.appliesToWorkspace(workspaceName)) {
                    updated = true;
                    configs.add(new SequencingConfiguration(expression, sequencer));
                }
            }
            if (DEBUG && updated) {
                LOGGER.debug("Updated sequencer '{0}' (id={1}) configuration due to new workspace '{2}' in repository '{3}'",
                             sequencer.getName(), sequencer.getUniqueId(), workspaceName, repository.name());
            }
        }
        if (configs.isEmpty()) return;
        // Otherwise, update the configs by workspace key ...
        try {
            configChangeLock.lock();
            // Make a copy of the existing map ...
            Map<String, Collection<SequencingConfiguration>> configByWorkspaceName = new HashMap<String, Collection<SequencingConfiguration>>(
                                                                                                                                              this.configByWorkspaceName);
            // Insert the new information ...
            configByWorkspaceName.put(workspaceName, configs);
            // Replace the exisiting map (which is used without a lock) ...
            this.configByWorkspaceName = configByWorkspaceName;
        } finally {
            configChangeLock.unlock();
        }
    }
575231
@Path("{snapshotId}/history")
    @POST
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public Response updateHistory(@PathParam("snapshotId") String snapshotId,
                                  UpdateSnapshotHistoryBridgeParameters params) {
        try {
            if (params.getAlternate() == null) {
                return Response.serverError()
                               .entity(new ResponseDetails("Incorrect parameters submitted!"))
                               .build();
            }
            Snapshot snapshot = (params.getAlternate() ?
                                 this.snapshotRepo.findBySnapshotAlternateIds(snapshotId) :
                                 this.snapshotRepo.findByName(snapshotId));

            // sanity check to make sure snapshot exists
            if (snapshot != null) {
                // sanity check input from history
                if (params.getHistory() != null &&
                    params.getHistory().length() > 0) {
                    // set history, and refresh our variable from the DB
                    snapshot = this.snapshotManager.updateHistory(snapshot,
                                                                  params.getHistory());
                    log.info("successfully processed snapshot " +
                             "history update: {}", snapshot);
                } else {
                    log.info("did not process empty or null snapshot " +
                             "history update: {}", snapshot);
                }
                SnapshotSummary snapSummary = createSnapshotSummary(snapshot);
                List<SnapshotHistory> snapMeta = snapshot.getSnapshotHistory();
                String history = // retrieve latest history update
                    ((snapMeta != null && snapMeta.size() > 0) ?
                     snapMeta.get(snapMeta.size() - 1).getHistory() : "");
                UpdateSnapshotHistoryBridgeResult result =
                    new UpdateSnapshotHistoryBridgeResult(snapSummary, history);

                log.debug("Returning results of update snapshot history: {}", result);
                return Response.ok(null)
                               .entity(result)
                               .build();
            } else {
                String error = "Snapshot with " +
                               (params.getAlternate() ? "alternate " : "") +
                               "id [" + snapshotId + "] not found!";
                return Response.serverError()
                               .entity(new ResponseDetails(error))
                               .build();
            }
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
            return Response.serverError()
                           .entity(new ResponseDetails(ex.getMessage()))
                           .build();
        }
    }
1288583
protected function findMissingShadowNodesInWorkspace(Workspace $workspace, NodeType $nodeType = null)
    {
        $workspaces = array_merge([$workspace], $workspace->getBaseWorkspaces());

        $newShadowNodes = [];
        foreach ($workspaces as $workspace) {
            /** @var Workspace $workspace */
            if ($workspace->getBaseWorkspace() === null) {
                continue;
            }

            /** @var QueryBuilder $queryBuilder */
            $queryBuilder = $this->entityManager->createQueryBuilder();
            $queryBuilder->select('n')
                ->from(NodeData::class, 'n')
                ->where('n.workspace = :workspace');
            $queryBuilder->setParameter('workspace', $workspace->getName());
            if ($nodeType !== null) {
                $queryBuilder->andWhere('n.nodeType = :nodeType');
                $queryBuilder->setParameter('nodeType', $nodeType->getName());
            }

            /** @var NodeData $nodeData */
            foreach ($queryBuilder->getQuery()->getResult() as $nodeData) {
                $nodeDataSeenFromParentWorkspace = $this->nodeDataRepository->findOneByIdentifier($nodeData->getIdentifier(), $workspace->getBaseWorkspace(), $nodeData->getDimensionValues());
                // This is the good case, either the node does not exist or was shadowed
                if ($nodeDataSeenFromParentWorkspace === null) {
                    continue;
                }
                // Also good, the node was not moved at all.
                if ($nodeDataSeenFromParentWorkspace->getPath() === $nodeData->getPath()) {
                    continue;
                }

                $nodeDataOnSamePath = $this->nodeDataRepository->findOneByPath($nodeData->getPath(), $workspace->getBaseWorkspace(), $nodeData->getDimensionValues(), null);
                // We cannot just put a shadow node in the path, something exists, but that should be fine.
                if ($nodeDataOnSamePath !== null) {
                    continue;
                }
                $newShadowNodes[] = ['nodeData' => $nodeData, 'shadowPath' => $nodeDataSeenFromParentWorkspace->getPath()];
            }
        }

        return $newShadowNodes;
    }
1153545
private void addWorkListItemsForClasspath(LinkedList<WorkListItem> workList, String path) {
        if (path == null) {
            return;
        }

        StringTokenizer st = new StringTokenizer(path, File.pathSeparator);
        while (st.hasMoreTokens()) {
            String entry = st.nextToken();
            if (DEBUG) {
                System.out.println("System classpath entry: " + entry);
            }
            addToWorkList(workList, new WorkListItem(classFactory.createFilesystemCodeBaseLocator(entry), false,
                    ICodeBase.Discovered.IN_SYSTEM_CLASSPATH));
        }
    }
381716
@Override
    public Node delete(ArchivePath path) {
        Validate.notNull(path, "No path was specified");
        ArchivePath safePath = path;

        NodeImpl node = content.get(safePath);
        if (node == null) {
            if (path.get().endsWith("/")) {
                safePath = ArchivePaths.create(path.get().substring(0, path.get().length() - 1));
                node = content.get(safePath);
            }
            if (node == null) {
                return null;
            }
        }

        return removeNodeRecursively(node, safePath);
    }