Package org.graylog2.plugin.utilities
Class FileInfo
java.lang.Object
org.graylog2.plugin.utilities.FileInfo
A
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.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
FileInfo
public FileInfo()
-
-
Method Details
-
key
-
size
public abstract long size() -
modificationTime
-
path
-
toBuilder
-
builder
-
forPath
Create a file info for the given path.- Parameters:
path
- the path must exist, otherwise an IllegalArgumentException is thrown- Returns:
- the file info object
-
empty
-
checkForChange
-