Home | History | Annotate | Download | only in util

Lines Matching defs:cache

58  * A cache that uses a bounded amount of space on a filesystem. Each cache
63 * <p>The cache stores its data in a directory on the filesystem. This
64 * directory must be exclusive to the cache; the cache may delete or overwrite
66 * same cache directory at the same time.
68 * <p>This cache limits the number of bytes that it will store on the
69 * filesystem. When the number of stored bytes exceeds the limit, the cache will
71 * not strict: the cache may temporarily exceed it while waiting for files to be
72 * deleted. The limit does not include filesystem overhead or the cache
95 * filesystem, the corresponding entries will be dropped from the cache. If
96 * an error occurs while writing a cache value, the edit will fail silently.
115 * This cache uses a journal file named "journal". A typical journal file
132 * constant string "libcore.io.DiskLruCache", the disk cache's version,
136 * cache entry. Each line contains space-separated values: a state, a key,
142 * o CLEAN lines track a cache entry that has been successfully published
148 * The journal file is appended to as cache operations occur. The journal may
151 * it exists when the cache is opened.
269 /** This cache uses a single background thread to evict entries. */
298 * Opens the cache in {@code directory}, creating a cache if none exists
303 * @param valueCount the number of values per cache entry. Must be positive.
304 * @param maxSize the maximum number of bytes this cache should use to store
305 * @throws java.io.IOException if reading or writing the cache directory fails
317 DiskLruCache cache = new DiskLruCache(directory, appVersion, valueCount, maxSize);
318 if (cache.journalFile.exists()) {
320 cache.readJournal();
321 cache.processJournal();
322 cache.journalWriter = new BufferedWriter(new FileWriter(cache.journalFile, true),
324 return cache;
328 cache.delete();
332 // create a new empty cache
334 cache = new DiskLruCache(directory, appVersion, valueCount, maxSize);
335 cache.rebuildJournal();
336 return cache;
401 * cache. Dirty entries are assumed to be inconsistent and will be deleted.
542 * Returns the directory where this cache stores its data.
549 * Returns the maximum number of bytes that this cache should use to store
558 * this cache. This may be greater than the max size if a background
660 * Returns true if this cache has been closed.
668 throw new IllegalStateException("cache is closed");
682 * Closes this cache. Stored values will remain on the filesystem.
707 * Closes the cache and deletes all of its stored values. This will delete
708 * all files in the cache directory including files that weren't created by
709 * the cache.