public ExplorerNode updateTags(final DocRef docRef, final Set<String> tags) {
        Objects.requireNonNull(docRef);
        ExplorerNode beforeNode = null;
        ExplorerNode afterNode = null;
        try {
            beforeNode = explorerNodeService.getNode(docRef)
                    .orElse(null);

            if (!securityContext.hasDocumentPermission(docRef, DocumentPermission.EDIT)) {
                throw new PermissionException(securityContext.getUserRef(),
                        "You must have 'Edit' permission on the document to change it's tags.");
            }

            explorerNodeService.updateTags(docRef, tags);

            afterNode = explorerNodeService.getNode(docRef)
                    .orElseThrow(() -> new RuntimeException(LogUtil.message(
                            "Can't find node {} after updating it", docRef)));

            explorerEventLog.update(beforeNode, afterNode, null);

            // Make sure the tree model is rebuilt.
            EntityEvent.fire(entityEventBus, docRef, EntityAction.UPDATE_EXPLORER_NODE);
            EntityEvent.fire(entityEventBus, docRef, EntityAction.UPDATE);
            return afterNode;
        } catch (final Exception e) {
            explorerEventLog.update(beforeNode, afterNode, e);
            throw e;
        }
    }
Create a map of folders and their child items.
stroom-explorer/stroom-explorer-impl/src/main/java/stroom/explorer/impl/ExplorerServiceImpl.java