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.Returns the LRU (least-recently-used) cache that is filled when usingIFileReader.readFile(String)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.- Specified by:
getCacheLockin interfaceIFileReader
-
getLruCache
Description copied from interface:IFileReaderReturns the LRU (least-recently-used) cache that is filled when usingIFileReader.readFile(String)- Specified by:
getLruCachein interfaceIFileReader
-