java.lang.Object
com.renomad.minum.utils.FileReader
- All Implemented Interfaces:
IFileReader
Reads files from disk, optionally storing into a LRU cache.
-
Constructor Summary
ConstructorsConstructorDescriptionFileReader(Map<String, byte[]> lruCache, boolean useCacheForStaticFiles, ILogger logger) -
Method Summary
Modifier and TypeMethodDescriptionReturns the lock used to prevent concurrent modification exceptions when mutating the LRU cache data.byte[]Reads a file from disk.
-
Constructor Details
-
FileReader
-
-
Method Details
-
readFile
Description copied from interface:IFileReaderReads a file from disk.- Specified by:
readFilein interfaceIFileReader- Throws:
IOException
-
getCacheLock
Returns the lock used to prevent concurrent modification exceptions when mutating the LRU cache data.
This may be useful if you need to access the LRU cache, which, owing to how a least-recently-used cache works, will cause the data to mutate, and which requires to be protected with locks.
-