@FunctionalInterface
public interface FileHasher
By default, this hasher may throw an IOException, which will be treated as a `null` hash by the watcher, meaning the associated event will be ignored. If you want to handle that exception you can catch/rethrow it.
| Modifier and Type | Field and Description |
|---|---|
static FileHasher |
DEFAULT_FILE_HASHER
The default file hasher instance, which uses Murmur3.
|
static FileHasher |
LAST_MODIFIED_TIME
A file hasher that returns the last modified time provided by the OS.
|
| Modifier and Type | Method and Description |
|---|---|
FileHash |
hash(java.nio.file.Path path) |
static final FileHasher DEFAULT_FILE_HASHER
static final FileHasher LAST_MODIFIED_TIME
This only works reliably on certain file systems and JDKs that support at least millisecond-level precision.
FileHash hash(java.nio.file.Path path) throws java.io.IOException
java.io.IOException