BlobCache

class BlobCache(containerUri: Uri, idGenerator: IdGenerator = DefaultIdGenerator())

Simple blob cache implementation that uses the file store.

Parameters

containerUri

cache container Uri.

idGenerator

UUID generator. Mainly used for unit testing.

Constructors

Link copied to clipboard
constructor(containerUri: Uri, idGenerator: IdGenerator = DefaultIdGenerator())

Types

Link copied to clipboard
data class Entry(val containerURL: Uri, val id: String)

Cache entry.

Functions

Link copied to clipboard
fun add(fileUri: Uri): BlobCache.Entry

Adds a blob located at a specified Uri to the cache.

Adds a blob to the cache.

Link copied to clipboard
fun count(): Int

Returns the number of entries in the cache.

Link copied to clipboard
fun get(uri: Uri): BlobCache.Entry?

Retrieves a cache entry.

Link copied to clipboard
fun remove(id: String)

Removes a cache entry.

Link copied to clipboard

Replaces a cache entry with the specified blob.

Link copied to clipboard
fun reset()

Removes all entries from the cache.