DefaultCacheRepository

class DefaultCacheRepository(context: Context, diagnostics: DiagnosticsReporter, deleteRecursively: (File) -> Boolean = File::deleteRecursively, dispatchers: DispatcherProvider = StandardDispatchers()) : CacheRepository(source)

Clears application cache directories on the IO dispatcher, since the recursive delete blocks. An incomplete deletion is logged here because callers cannot identify the failed directories.

Parameters

deleteRecursively

Returns true when the entire directory was deleted, or false for an incomplete deletion.

Constructors

Link copied to clipboard
constructor(context: Context, diagnostics: DiagnosticsReporter, deleteRecursively: (File) -> Boolean = File::deleteRecursively, dispatchers: DispatcherProvider = StandardDispatchers())

Functions

Link copied to clipboard
open suspend override fun clearCache()

Deletes the application's cache directories. Main-safe.