public abstract class FileInfo extends Object
FileInfo presents a concise way of checking for file modification based on its file system attributes.
Construct it via its forPath(Path) method and later use the checkForChange() method
whenever you want to act if a modification has occurred. The returned FileInfo.Change object contains whether
the file has actually changed and the new file info object to use in future checks.
| Modifier and Type | Class and Description |
|---|---|
static class |
FileInfo.Builder |
static class |
FileInfo.Change |
| Constructor and Description |
|---|
FileInfo() |
| Modifier and Type | Method and Description |
|---|---|
static FileInfo.Builder |
builder() |
FileInfo.Change |
checkForChange() |
static @NotNull FileInfo |
empty() |
static @NotNull FileInfo |
forPath(Path path)
Create a file info for the given path.
|
abstract Object |
key() |
abstract FileTime |
modificationTime() |
abstract Path |
path() |
abstract long |
size() |
protected abstract FileInfo.Builder |
toBuilder() |
public abstract long size()
public abstract Path path()
protected abstract FileInfo.Builder toBuilder()
public static FileInfo.Builder builder()
@NotNull public static @NotNull FileInfo forPath(Path path)
path - the path must exist, otherwise an IllegalArgumentException is thrown@NotNull public static @NotNull FileInfo empty()
@NotNull public FileInfo.Change checkForChange()
Copyright © 2012–2021 Graylog, Inc.. All rights reserved.