@Override
    public void accept(MetadataShellState state) {
        String fullGlob = glob.startsWith("/") ? glob :
            state.workingDirectory() + "/" + glob;
        List<String> globComponents =
            CommandUtils.stripDotPathComponents(CommandUtils.splitPath(fullGlob));
        MetadataNode root = state.root();
        if (root == null) {
            throw new RuntimeException("Invalid null root");
        }
        if (!accept(globComponents, 0, root, new String[0])) {
            handler.accept(Optional.empty());
        }
    }
Visits metadata paths based on a glob string.
shell/src/main/java/org/apache/kafka/shell/glob/GlobVisitor.java