@Override
    public HealthCheck.Result getHealth() {
        HealthCheck.ResultBuilder resultBuilder = HealthCheck.Result.builder();

        // isRunning will only be true if the file is also present and valid
        if (dirToWatch == null) {
            resultBuilder.healthy()
                    .withMessage("No file provided to monitor");
        } else if (isRunning.get()) {
            resultBuilder.healthy();
        } else {
            resultBuilder
                    .unhealthy()
                    .withDetail("errors", errors);
        }

        return resultBuilder
                .withDetail("monitoredFile", dirToWatch != null
                        ? dirToWatch.toAbsolutePath().normalize().toString()
                        : null)
                .withDetail("isRunning", isRunning)
                .withDetail("isValidFile", isValidDir)
                .build();
    }
Stops the object. Called <i>after</i> the application is no longer accepting requests.

@throws Exception if something goes wrong.
stroom-util/src/main/java/stroom/util/io/AbstractDirChangeMonitor.java