@Deprecated // Should no longer be needed if the new ShardLockFactory works ok
    private void deleteLockFiles(final Path dir) {
        // Delete any lingering lock files from previous uses of the index shard.
        if (Files.isDirectory(dir)) {
            try (final DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "*.lock")) {
                stream.forEach(file -> {
                    try {
                        Files.deleteIfExists(file);
                    } catch (final IOException e) {
                        LOGGER.error(e::getMessage, e);
                    }
                });
            } catch (final IOException e) {
                LOGGER.error(e::getMessage, e);
            }
        }
    }
Remove any lingering lock files in an index shard directory. These lock files can be left behind if the JVM
terminates abnormally and need to be removed when the system restarts.

@param dir The directory to remove lock files from.
stroom-index/stroom-index-impl/src/main/java/stroom/index/impl/IndexShardWriterCacheImpl.java