private void download(final String feedName,
                          final String streamType,
                          final String createPeriodFrom,
                          final String createPeriodTo,
                          final Path dir,
                          final String format,
                          final DataDownloadTaskHandler dataDownloadTaskHandler) {
        System.out.println("Dumping data for " + feedName);

        final ExpressionOperator.Builder builder = ExpressionOperator.builder();

        if (createPeriodFrom != null
                && !createPeriodFrom.isEmpty()
                && createPeriodTo != null
                && !createPeriodTo.isEmpty()) {
            builder.addDateTerm(MetaFields.CREATE_TIME, Condition.BETWEEN, createPeriodFrom + "," + createPeriodTo);
        } else if (createPeriodFrom != null && !createPeriodFrom.isEmpty()) {
            builder.addDateTerm(MetaFields.CREATE_TIME, Condition.GREATER_THAN_OR_EQUAL_TO, createPeriodFrom);
        } else if (createPeriodTo != null && !createPeriodTo.isEmpty()) {
            builder.addDateTerm(MetaFields.CREATE_TIME, Condition.LESS_THAN_OR_EQUAL_TO, createPeriodTo);
        }

        if (feedName != null) {
            builder.addTextTerm(MetaFields.FEED, Condition.EQUALS, feedName);
        }

        if (streamType != null) {
            builder.addTextTerm(MetaFields.TYPE, Condition.EQUALS, streamType);
        }

        final FindMetaCriteria criteria = new FindMetaCriteria();
        criteria.setExpression(builder.build());
        criteria.addSort(MetaFields.FIELD_FEED, false, true);
        criteria.addSort(MetaFields.FIELD_ID, false, true);

        final DataDownloadSettings dataDownloadSettings = new DataDownloadSettings();
        dataDownloadSettings.setMultipleFiles(true);
        dataDownloadSettings.setMaxFileSize(ModelStringUtil.parseIECByteSizeString("2G"));
        dataDownloadSettings.setMaxFileParts(10000L);

        final TaskContext taskContext = new TaskContext() {
            @Override
            public void info(final Supplier<String> messageSupplier) {
                System.out.println(messageSupplier.get());
            }

            @Override
            public TaskId getTaskId() {
                return null;
            }

            @Override
            public void reset() {
            }
        };
        dataDownloadTaskHandler.downloadData(taskContext, criteria, dir, format, dataDownloadSettings);


//        final StreamStore streamStore = appContext.getBean(StreamStore.class);
//        final FeedService feedService = (FeedService) appContext.getBean("cachedFeedService");
//        final StreamTypeService streamTypeService = (StreamTypeService) appContext.getBean("cachedStreamTypeService");
//
//        new ThreadScopeRunnable() {
//            @Override
//            protected void exec() {
//                Feed definition = null;
//                if (feed != null) {
//                    definition = feedService.loadByName(feed);
//                    if (definition == null) {
//                        throw new RuntimeException("Unable to locate Feed " + feed);
//                    }
//                    criteria.obtainFeeds().obtainInclude().add(definition.getId());
//                }
//
//                if (streamType != null) {
//                    final StreamType type = streamTypeService.loadByName(streamType);
//                    if (type == null) {
//                        throw new RuntimeException("Unable to locate stream type " + streamType);
//                    }
//                    criteria.obtainStreamTypeIdSet().add(type.getId());
//                } else {
//                    criteria.obtainStreamTypeIdSet().add(StreamType.RAW_EVENTS.getId());
//                }
//
//                // Query the stream store
//                final List<Stream> results = streamStore.find(criteria);
//                System.out.println("Starting dump of " + results.size() + " streams");
//
//                int count = 0;
//                for (final Stream stream : results) {
//                    count++;
//                    processFile(count, results.size(), streamStore, stream.getId(), dir);
//                }
//
//                System.out.println("Finished dumping " + results.size() + " streams");
//            }
//        }.run();
    }
Handy tool to dump out content.
stroom-data/stroom-data-store-util/src/main/java/stroom/data/store/util/StreamDumpTool.java