/** * Closes the cache and deletes all of its stored values. This will delete * all files in the cache directory including files that weren't created by * the cache. */ public void delete() throws IOException { close(); Util.deleteContents(directory); }
/** * Closes the underlying Disk LRU Cache. (if one is in use) * @throws IOException if an I/O error occurs * @see DiskLruCache#close() */ @Override public void close() throws IOException { if (diskLruCache != null) { diskLruCache.close(); } } }
/** * Closes the underlying Disk LRU Cache. (if one is in use) * @throws IOException if an I/O error occurs * @see DiskLruCache#close() */ @Override public void close() throws IOException { if (diskLruCache != null) { diskLruCache.close(); } } }
/** * Closes the disk cache. Stored values will remain on the file system. * * @throws IOException */ public synchronized final void close() throws IOException { if (mDiskCache != null) { mDiskCache.close(); } }
public DiskCacheManager(Context context, String uniqueName) { try { //先关闭已有的缓存 if (mDiskLruCache != null) { mDiskLruCache.close(); mDiskLruCache = null; } File cacheFile = getCacheFile(context, uniqueName); mDiskLruCache = DiskLruCache.open(cacheFile, MyApplication.getAppVersion(), 1, Constants.CACHE_MAXSIZE); } catch (IOException e) { e.printStackTrace(); } }
mDiskLruCache.close(); mDiskLruCache = null;
try { if (!mDiskLruCache.isClosed()) { mDiskLruCache.close(); mDiskLruCache = null; if (BuildConfig.DEBUG) {