Package com.firebolt.jdbc.cache
Class FileService
java.lang.Object
com.firebolt.jdbc.cache.FileService
-
Method Summary
Modifier and TypeMethodDescriptionfindFileForKey
(CacheKey cacheKey) Returns true if the file exists.static FileService
readContent
(CacheKey cacheKey, File cacheFile) void
safelyDeleteFile
(Path filePath) void
safeSaveToDiskAsync
(CacheKey cacheKey, ConnectionCache connectionCache) boolean
wasFileCreatedBeforeTimestamp
(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
-
findFileForKey
Returns true if the file exists. False otherwise- Parameters:
cacheKey
- - the key for which we are looking for the file- Returns:
- Throws:
FilenameGenerationException
-
safeSaveToDiskAsync
-
readContent
public Optional<ConnectionCache> readContent(CacheKey cacheKey, File cacheFile) throws ConnectionCacheDeserializationException -
safelyDeleteFile
-
wasFileCreatedBeforeTimestamp
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.- Returns:
- - true if the file was created before the specified time
-