boolean deleteFilesByBaseName(final long metaId,
                                  final Path dir,
                                  final String baseName,
                                  final LongConsumer deleteCountConsumer) {
        Objects.requireNonNull(dir);
        Objects.requireNonNull(baseName);
        final String glob = baseName + ".*";
        final AtomicBoolean wasSuccessful = new AtomicBoolean(true);
        try (final DirectoryStream<Path> stream = Files.newDirectoryStream(dir, glob)) {
            stream.forEach(file -> {
                if (!Thread.currentThread().isInterrupted()) {
                    try {
                        final Supplier<String> msgSupplier = () -> "Deleting file: '"
                                + FileUtil.getCanonicalPath(file)
                                + "' for stream "
                                + metaId;
                        info(msgSupplier);

                        // Doesn't matter if it does not exist as that is the desired end state anyway
                        final boolean didDelete = Files.deleteIfExists(file);

                        if (deleteCountConsumer != null && didDelete) {
                            deleteCountConsumer.accept(1L);
                        }

                        if (LOGGER.isDebugEnabled()) {
                            LOGGER.debug("File '{}' {}",
                                    FileUtil.getCanonicalPath(file),
                                    (didDelete
                                            ? "deleted"
                                            : "doesn't exist"));
                        }
                    } catch (final IOException e) {
                        wasSuccessful.compareAndSet(true, false);
                        final String msg = "Error deleting file '" +
                                FileUtil.getCanonicalPath(file) +
                                "' for meta ID " +
                                metaId;
                        LOGGER.debug(msg, e);
                        LOGGER.error(msg + " - "
                                + e.getClass().getSimpleName() + " - " + e.getMessage()
                                + " (see DEBUG for stacktrace)");
                    }
                } else {
                    // We probably haven't finished so treat as failure.  Next run of the job can finish it.
                    // Although we keep looping it should only be a few files so will drop out quickly
                    // with a failure returned.
                    wasSuccessful.compareAndSet(true, false);
                    LOGGER.debug("Thread interrupted for stream: {}, dir: '{}', file: {}", metaId, dir, file);
                }
            });
        } catch (final IOException e) {
            wasSuccessful.compareAndSet(true, false);
            final String msg = "Error creating directory stream '" +
                    FileUtil.getCanonicalPath(dir) +
                    "' for stream " + metaId + ", glob=" + glob;
            LOGGER.debug(msg, e);
            LOGGER.error(msg + " - "
                    + e.getClass().getSimpleName() + " - " + e.getMessage()
                    + " (see DEBUG for stacktrace)");
        }
        return wasSuccessful.get();
    }
Deletes all files of the form '{@code <baseName>.*}' in directory {@code dir}.
Not recursive.
All IO errors are logged as errors and swallowed.

@param metaId   The meta record the files belong to, used for logging.
@param dir      The dir to delete files from.
@param baseName The base of the filename, i.e. without extension.
@return False if any errors occurred deleting files. Missing files do not count as errors.
stroom-data/stroom-data-store-impl-fs/src/main/java/stroom/data/store/impl/fs/FsFileDeleter.java