private void addRemoveTags(final List<DocRef> docRefs,
                               final Set<String> tags,
                               final TagOperation tagOperation) {

        if (NullSafe.hasItems(tags)) {
            for (final DocRef docRef : NullSafe.list(docRefs)) {

                explorerNodeService.getNode(docRef).ifPresent(node -> {
                    final Set<String> nodeTags = new HashSet<>(NullSafe.set(node.getTags()));
                    if (TagOperation.ADD.equals(tagOperation)) {
                        nodeTags.addAll(tags);
                    } else {
                        nodeTags.removeAll(tags);
                    }

                    updateTags(docRef, nodeTags);
                });
            }
        }
    }
Create a map of folders and their child items.
stroom-explorer/stroom-explorer-impl/src/main/java/stroom/explorer/impl/ExplorerServiceImpl.java