Lines Matching refs:entry

102      * Returns the cache entry with the specified key if it exists, null otherwise.
106 CacheHeader entry = mEntries.get(key);
107 // if the entry does not exist, return.
108 if (entry == null) {
118 return entry.toCacheEntry(data);
155 CacheHeader entry = CacheHeader.readHeader(fis);
156 entry.size = file.length();
157 putEntry(entry.key, entry);
173 * Invalidates an entry in the cache.
175 * @param fullExpire True to fully expire the entry, false to soft expire
179 Entry entry = get(key);
180 if (entry != null) {
181 entry.softTtl = 0;
183 entry.ttl = 0;
185 put(key, entry);
191 * Puts the entry with the specified key into the cache.
194 public synchronized void put(String key, Entry entry) {
195 pruneIfNeeded(entry.data.length);
199 CacheHeader e = new CacheHeader(key, entry);
201 fos.write(entry.data);
221 VolleyLog.d("Could not delete cache entry for key=%s, filename=%s",
263 Map.Entry<String, CacheHeader> entry = iterator.next();
264 CacheHeader e = entry.getValue();
269 VolleyLog.d("Could not delete cache entry for key=%s, filename=%s",
287 * Puts the entry with the specified key into the cache.
288 * @param key The key to identify the entry by.
289 * @param entry The entry to cache.
291 private void putEntry(String key, CacheHeader entry) {
293 mTotalSize += entry.size;
296 mTotalSize += (entry.size - oldEntry.size);
298 mEntries.put(key, entry);
302 * Removes the entry identified by 'key' from the cache.
305 CacheHeader entry = mEntries.get(key);
306 if (entry != null) {
307 mTotalSize -= entry.size;
329 * Handles holding onto the cache headers for an entry.
337 /** The key that identifies the cache entry. */
352 /** Headers from the response resulting in this cache entry. */
359 * @param key The key that identifies the cache entry
360 * @param entry The cache entry.
362 public CacheHeader(String key, Entry entry) {
364 this.size = entry.data.length;
365 this.etag = entry.etag;
366 this.serverDate = entry.serverDate;
367 this.ttl = entry.ttl;
368 this.softTtl = entry.softTtl;
369 this.responseHeaders = entry.responseHeaders;
378 CacheHeader entry = new CacheHeader();
384 entry.key = readString(is);
385 entry.etag = readString(is);
386 if (entry.etag.equals("")) {
387 entry.etag = null;
389 entry.serverDate = readLong(is);
390 entry.ttl = readLong(is);
391 entry.softTtl = readLong(is);
392 entry.responseHeaders = readStringStringMap(is);
393 return entry;
397 * Creates a cache entry for the specified data.
533 for (Map.Entry<String, String> entry : map.entrySet()) {
534 writeString(os, entry.getKey());
535 writeString(os, entry.getValue());