| com.facebook.cache.disk.FileCache |
Known Indirect Subclasses
|
Interface that caches based on disk should implement.
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| abstract void | clearAll() | ||||||||||
| abstract long |
clearOldEntries(long cacheExpirationMs)
Deletes old cache files.
| ||||||||||
| abstract long | getCount() | ||||||||||
| abstract DiskStorage.DiskDumpInfo | getDumpInfo() | ||||||||||
| abstract BinaryResource |
getResource(CacheKey key)
Returns the binary resource cached with key.
| ||||||||||
| abstract long | getSize() | ||||||||||
| abstract boolean | hasKey(CacheKey key) | ||||||||||
| abstract boolean |
hasKeySync(CacheKey key)
Returns true if the key is in the in-memory key index.
| ||||||||||
| abstract BinaryResource |
insert(CacheKey key, WriterCallback writer)
Inserts resource into file with key
| ||||||||||
| abstract boolean |
isEnabled()
Tells if this cache is enabled.
| ||||||||||
| abstract boolean | probe(CacheKey key) | ||||||||||
| abstract void |
remove(CacheKey key)
Removes a resource by key from cache.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.facebook.common.disk.DiskTrimmable
| |||||||||||
Deletes old cache files.
| cacheExpirationMs | files older than this will be deleted. |
|---|
Returns the binary resource cached with key.
Returns true if the key is in the in-memory key index.
Not guaranteed to be correct. The cache may yet have this key even if this returns false. But if it returns true, it definitely has it.
Avoids a disk read.
Inserts resource into file with key
| key | cache key |
|---|---|
| writer | Callback that writes to an output stream |
| IOException |
|---|
Tells if this cache is enabled. It's important for some caches that can be disabled without further notice (like in removable/unmountable storage). Anyway a disabled cache should just ignore calls, not fail.
Removes a resource by key from cache.
| key | cache key |
|---|