public void scan(final Consumer<Path> orphanConsumer, final TaskContext parentContext) {
        parentContext.info(() -> "Starting orphan file finder task. oldAge = " + oldAge);
        Instant oldestDirTime = Instant.now();
        oldestDirTime = oldestDirTime.minus(oldAge);

        final LogExecutionTime logExecutionTime = LogExecutionTime.start();

        final List<FsVolume> volumeList = volumeService.find(FindFsVolumeCriteria.matchAll()).getValues();
        if (volumeList != null && volumeList.size() > 0) {
            for (final FsVolume volume : volumeList) {
                if (Thread.currentThread().isInterrupted() || parentContext.isTerminated()) {
                    LOGGER.info("{} - Task terminated", TASK_NAME);
                    break;
                }
                if (VolumeUseStatus.ACTIVE.equals(volume.getStatus())) {
                    scanVolume(volume, orphanConsumer, oldestDirTime, parentContext);
                }
            }
        }
        parentContext.info(() -> "start() - Completed orphan file finder in " + logExecutionTime);
    }
Task to clean the stream store.
stroom-data/stroom-data-store-impl-fs/src/main/java/stroom/data/store/impl/fs/FsOrphanFileFinderExecutor.java