packagecom.danikula.videocache.file;importjava.io.File;/** * {@link DiskUsage} that uses LRU (Least Recently Used) strategy and trims cache size to max size if needed. * * @author Alexey Danilov (danikula@gmail.com). */publicclassTotalSizeLruDiskUsageextendsLruDiskUsage{privatefinallongmaxSize;publicTotalSizeLruDiskUsage(longmaxSize){if(maxSize<=0){thrownewIllegalArgumentException("Max size must be positive number!");}this.maxSize=maxSize;}@Overrideprotectedbooleanaccept(Filefile,longtotalSize,inttotalCount){returntotalSize<=maxSize;}}