Package 

Interface FileCache

  • All Implemented Interfaces:
    com.facebook.common.disk.DiskTrimmable

    
    public interface FileCache
     implements DiskTrimmable
                        

    Interface that caches based on disk should implement.

    • Method Detail

      • isEnabled

         abstract boolean isEnabled()

        Tells if this cache is enabled. It's important for some caches that can be disabled withoutfurther notice (like in removable/unmountable storage). Anyway a disabled cache should justignore calls, not fail.

      • hasKeySync

         abstract boolean hasKeySync(CacheKey key)

        Returns true if the key is in the in-memory key index.

        Not guaranteed to be correct. The cache may yet have this key even if this returns false.But if it returns true, it definitely has it.

        Avoids a disk read.

      • remove

         abstract void remove(CacheKey key)

        Removes a resource by key from cache.

        Parameters:
        key - cache key
      • clearOldEntries

         abstract long clearOldEntries(long cacheExpirationMs)

        Deletes old cache files.

        Parameters:
        cacheExpirationMs - files older than this will be deleted.