Package com.codingchili.core.files
Class CachedFileStore
java.lang.Object
com.codingchili.core.files.CachedFileStore
- All Implemented Interfaces:
FileStoreListener
Caches files from disk in memory and reloads them on change.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCachedFileStore(CoreContext context, CachedFileStoreSettings settings)Maintain a CachedFileStore for each loaded directory. -
Method Summary
Modifier and TypeMethodDescriptionaddListener(FileStoreListener listener)getFiles()voidonFileModify(Path path)Triggered when a file on the registered path has been modified or created.voidonFileRemove(Path path)Triggered when a file on the registered path has been deleted.
-
Field Details
-
context
-
-
Constructor Details
-
CachedFileStore
Maintain a CachedFileStore for each loaded directory.- Parameters:
context- the context requesting the feature.settings- the settings to use for the CachedFileStore, if conflicting with any existing configuration for the given path the configuration is ignored.
-
-
Method Details
-
onFileModify
Description copied from interface:FileStoreListenerTriggered when a file on the registered path has been modified or created.- Specified by:
onFileModifyin interfaceFileStoreListener- Parameters:
path- the basedir-relative path to the file that was modified.
-
onFileRemove
Description copied from interface:FileStoreListenerTriggered when a file on the registered path has been deleted.- Specified by:
onFileRemovein interfaceFileStoreListener- Parameters:
path- the basedir-relative path to the file that was modified.
-
getFiles
-
getFile
- Throws:
FileMissingException
-
addListener
- Parameters:
listener- a modify/remove event listener.- Returns:
- fluent
-