public class DirectoryCache
extends java.lang.Object
コンストラクタと説明 |
---|
DirectoryCache(java.nio.file.Path folder,
java.lang.String fileName) |
修飾子とタイプ | メソッドと説明 |
---|---|
void |
addProtectedPath(java.nio.file.Path p_218456_1_) |
java.lang.String |
getPreviousHash(java.nio.file.Path fileIn)
Gets the previous hash of a file, so that it doesn't need to be written to disk.
|
boolean |
isStale(java.nio.file.Path fileIn) |
void |
recordHash(java.nio.file.Path fileIn,
java.lang.String hash)
Inform the cache that a file has been written to
fileIn with contents hashing to hash . |
void |
writeCache()
Writes the cache file containing the hashes of newly created files to the disk, and deletes any stale files.
|
public DirectoryCache(java.nio.file.Path folder, java.lang.String fileName) throws java.io.IOException
java.io.IOException
public void writeCache() throws java.io.IOException
java.io.IOException
@Nullable public java.lang.String getPreviousHash(java.nio.file.Path fileIn)
recordHash
has been called.recordHash
was called on the previous run, or null
if
the file does not exist, or an empty string if the file exists but was not recorded. Note that the hash is
not based on the current bytes on disk.public void recordHash(java.nio.file.Path fileIn, java.lang.String hash)
fileIn
with contents hashing to hash
.public boolean isStale(java.nio.file.Path fileIn)
public void addProtectedPath(java.nio.file.Path p_218456_1_)