get

open fun get(directory: File, maxSize: Long): DiskCache

Get a DiskCache in the given directory and size. If a disk cache has already been created with a different directory and/or size, it will be returned instead and the new arguments will be ignored.

Return

The new disk cache with the given arguments, or the current cache if one already exists

Deprecated

Use create to create a new cache with the specified arguments.

Parameters

directory

The directory for the disk cache

maxSize

The max size for the disk cache


open fun get(key: Key): File

Get the cache for the value at the given key.

Note - This is potentially dangerous, someone may write a new value to the file at any point in time and we won't know about it.

Return

An InputStream representing the data at key at the time get is called.

Parameters

key

The key in the cache.