Package 

Interface DiskStorage


  • 
    public interface DiskStorage
    
                        

    Storage for files in the cache. Responsible for maintaining state (count, size, watch file existence, reachability)

    • Method Detail

      • isEnabled

         abstract boolean isEnabled()

        is this storage enabled?

      • isExternal

         abstract boolean isExternal()

        is this storage external?

      • getResource

        @Nullable() abstract BinaryResource getResource(String resourceId, Object debugInfo)

        Get the resource with the specified name

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

         abstract 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

         abstract 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

         abstract 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

         abstract long remove(DiskStorage.Entry entry)

        Remove the resource represented by the entry

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

         abstract long remove(String resourceId)

        Remove the resource with specified id

      • clearAll

         abstract void clearAll()

        Clear all contents of the storage