Package 

Interface DiskCache.Editor


  • @ExperimentalCoilApi() 
    public interface DiskCache.Editor
    
                        

    Edits the values for an entry.

    Calling metadata or data marks that file as dirty so it will be persisted to disk if this editor is committed.

    IMPORTANT: You must only read or modify the contents of metadata or data. Renaming, locking, or other mutating file operations can corrupt the disk cache.

    • Method Summary

      Modifier and Type Method Description
      abstract Unit commit() Commit the edit so the changes are visible to readers.
      abstract DiskCache.Snapshot commitAndGet() Commit the edit and open a new Snapshot atomically.
      abstract Unit abort() Abort the edit.
      abstract Path getMetadata() Get the metadata for this entry.
      abstract Path getData() Get the data for this entry.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • commit

         abstract Unit commit()

        Commit the edit so the changes are visible to readers.

      • abort

         abstract Unit abort()

        Abort the edit. Any written data will be discarded.

      • getMetadata

         abstract Path getMetadata()

        Get the metadata for this entry.

      • getData

         abstract Path getData()

        Get the data for this entry.