Package com.firebolt.jdbc.cache
Class FileService
java.lang.Object
com.firebolt.jdbc.cache.FileService
- 
Method SummaryModifier and TypeMethodDescriptionfindFileForKey(CacheKey cacheKey) Returns true if the file exists.static FileServicereadContent(CacheKey cacheKey, File cacheFile) voidsafelyDeleteFile(Path filePath) voidsafeSaveToDiskAsync(CacheKey cacheKey, ConnectionCache connectionCache) booleanwasFileCreatedBeforeTimestamp(File file, long value, ChronoUnit timeUnit) From the current time we subtract the value passed in as parameter and compare it against the file creation time from disk The assumption is that the file exists.
- 
Method Details- 
getInstance
- 
findFileForKeyReturns true if the file exists. False otherwise- Parameters:
- cacheKey- - the key for which we are looking for the file
- Returns:
- Throws:
- FilenameGenerationException
 
- 
safeSaveToDiskAsync
- 
readContentpublic Optional<ConnectionCache> readContent(CacheKey cacheKey, File cacheFile) throws ConnectionCacheDeserializationException 
- 
safelyDeleteFile
- 
wasFileCreatedBeforeTimestampFrom the current time we subtract the value passed in as parameter and compare it against the file creation time from disk The assumption is that the file exists.- Returns:
- - true if the file was created before the specified time
 
 
-