Back to project page satstat.
The source code is released under:
GNU General Public License
If you think the Android project satstat listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.vonglasow.michael.satstat.mapsforge; /*from ww w. ja v a 2s. c o m*/ import java.io.File; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; import org.mapsforge.core.util.LRUCache; class FileLRUCache<T> extends LRUCache<T, File> { private static final Logger LOGGER = Logger.getLogger(FileLRUCache.class.getName()); private static final long serialVersionUID = 1L; FileLRUCache(int capacity) { super(capacity); } @Override protected boolean removeEldestEntry(Map.Entry<T, File> eldest) { if (size() > this.capacity) { remove(eldest.getKey()); File file = eldest.getValue(); if (file.exists() && !file.delete()) { LOGGER.log(Level.SEVERE, "could not delete file: " + file); } return true; } return false; } }