Package 

Class DynamicDefaultDiskStorage

  • All Implemented Interfaces:
    com.facebook.cache.disk.DiskStorage

    
    public class DynamicDefaultDiskStorage
     implements DiskStorage
                        

    A supplier of a DiskStorage concrete implementation.

    • Constructor Detail

      • DynamicDefaultDiskStorage

        DynamicDefaultDiskStorage(int version, Supplier<File> baseDirectoryPathSupplier, String baseDirectoryName, CacheErrorLogger cacheErrorLogger)
    • Method Detail

      • isEnabled

         boolean isEnabled()

        is this storage enabled?

      • isExternal

         boolean isExternal()

        is this storage external?

      • contains

         boolean contains(String resourceId, Object debugInfo)

        Does a resource with this name exist?

        Parameters:
        resourceId - id of the resource
        debugInfo - helper object for debugging
      • touch

         boolean touch(String resourceId, Object debugInfo)

        Does a resource with this name exist? If so, update the last-accessed time for the resource

        Parameters:
        resourceId - id of the resource
        debugInfo - helper object for debugging
      • insert

         DiskStorage.Inserter insert(String resourceId, Object debugInfo)

        Creates a temporary resource for writing content. Split from commit() in order to allowconcurrent writing of cache entries. This entry will not be available to cache clients untilcommit() is called passing in the resource returned from this method.

        Parameters:
        resourceId - id of the resource
        debugInfo - helper object for debugging
      • remove

         long remove(DiskStorage.Entry entry)

        Remove the resource represented by the entry

        Parameters:
        entry - entry of the resource to delete
      • remove

         long remove(String resourceId)

        Remove the resource with specified id

      • clearAll

         void clearAll()

        Clear all contents of the storage