@Test public void emptyCache() throws Exception { cache.close(); assertJournalEquals(); }
public synchronized void close() throws IOException { if (journalWriter == null) { return; } for (Entry entry : new ArrayList<Entry>(lruEntries.values())) { if (entry.currentEditor != null) { entry.currentEditor.abort(); } } trimToSize(); journalWriter.close(); journalWriter = null; }
DiskLruCache implements Closeable { public synchronized void close() throws IOException { if (journalWriter == null) { return; } for (Entry entry : new ArrayList<Entry>(lruEntries.values())) { if (entry.currentEditor != null) { entry.currentEditor.abort(); } } trimToSize(); journalWriter.close(); journalWriter = null; } }
DiskLruCache implements Closeable { public synchronized void close() throws IOException { if (journalWriter == null) { return; } for (Entry entry : new ArrayList<Entry>(lruEntries.values())) { if (entry.currentEditor != null) { entry.currentEditor.abort(); } } trimToSize(); journalWriter.close(); journalWriter = null; } private  DiskLruCache(File directory, int appVersion, int valueCount, long maxSize); }
DiskLruCache implements Closeable { public synchronized void close() throws IOException { if (journalWriter == null) { return; } for (Entry entry : new ArrayList<Entry>(lruEntries.values())) { if (entry.currentEditor != null) { entry.currentEditor.abort(); } } trimToSize(); journalWriter.close(); journalWriter = null; } private  DiskLruCache(File directory, int appVersion, int valueCount, long maxSize); static DiskLruCache open(File directory, int appVersion, int valueCount, long maxSize); synchronized Snapshot get(String key); Editor edit(String key); File getDirectory(); synchronized long getMaxSize(); synchronized void setMaxSize(long maxSize); synchronized long size(); synchronized boolean remove(String key); synchronized boolean isClosed(); synchronized void flush(); synchronized void close(); void delete(); }
DiskLruCache implements Closeable { public synchronized void close() throws IOException { if (journalWriter == null) { return; } for (Entry entry : new ArrayList<Entry>(lruEntries.values())) { if (entry.currentEditor != null) { entry.currentEditor.abort(); } } trimToSize(); journalWriter.close(); journalWriter = null; } private  DiskLruCache(File directory, int appVersion, int valueCount, long maxSize); static DiskLruCache open(File directory, int appVersion, int valueCount, long maxSize); synchronized Snapshot get(String key); Editor edit(String key); File getDirectory(); synchronized long getMaxSize(); synchronized void setMaxSize(long maxSize); synchronized long size(); synchronized boolean remove(String key); synchronized boolean isClosed(); synchronized void flush(); synchronized void close(); void delete();  }