public class FileTreeCache extends Object implements GraphEngineCache<FileTreeKey,FileTree>
| Modifier and Type | Class and Description |
|---|---|
static class |
FileTreeCache.Invalidator
Subscribes to watchman event and invalidates internal state of a provided
FileTreeCache |
| Modifier and Type | Method and Description |
|---|---|
Optional<FileTree> |
get(FileTreeKey key)
Optionally returns the cached result given the key
|
FileTreeCache.Invalidator |
getInvalidator() |
static FileTreeCache |
of(Path rootPath)
Create a new instance of
FileTreeCache |
void |
put(FileTreeKey key,
FileTree fileTree)
Offers the given key and value for caching
|
public static FileTreeCache of(Path rootPath)
FileTreeCacherootPath - Absolute path to the root folder for which files and subfolders are cached,
this is usually the root path of the cellpublic Optional<FileTree> get(FileTreeKey key)
GraphEngineCacheget in interface GraphEngineCache<FileTreeKey,FileTree>key - The desired keypublic void put(FileTreeKey key, FileTree fileTree)
GraphEngineCacheput in interface GraphEngineCache<FileTreeKey,FileTree>key - the key to cachefileTree - the value to cachepublic FileTreeCache.Invalidator getInvalidator()