JakeWharton / DiskLruCache

Java implementation of a Disk-based LRU cache which specifically targets Android compatibility.
http://jakewharton.github.io/DiskLruCache
Apache License 2.0
5.79k stars 1.18k forks source link

Added public method cleanupIfNeeded #50

Closed JogahCR closed 10 years ago

JogahCR commented 10 years ago

Applications may need to explicitly request a disk cache cleanup in some circumstances.

For example in our application we detect if the device hits an exception due to being very low on disk space, and if it is we reduce the size of our disk cache and immediately tell it to discard some files. Doing that our application will be functional until there is no more space to release from our internal directories.