Cache
This guide describes the methods to manage cache.
#
Get Cache Dir PathThe following code example demonstrates getting a cache directory path.
// Add trailing slash.val addTrailingSlash: Boolean = false
// Returns path where library caches files. App may use this folder too.FileManager.cache.getCacheDirPath(true)
#
Get And Create Cache Dir PathThe following code example demonstrates creating a cache directory and getting a path to that directory.
// Add trailing slash.val addTrailingSlash: Boolean = false
// Returns path where library caches files. App may use this folder too.FileManager.cache.getAndCreateCacheDirPath(true)
#
Get Cache SizeThe function getCacheSize()
returns a total size of the cache directory content in bytes. The following code example demonstrates clearing the cache.
FileManager.cache.getCacheSize()
#
Clear CacheThe function clearCache()
deletes the files located in the directory, returned by getCacheDirPath(). Note this method is blocking. The following code example demonstrates clearing the cache.
FileManager.cache.clearCache()