Package 

Interface DiskCache


  • 
    public interface DiskCache
    
                        

    An LRU cache of files.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public interface DiskCache.Snapshot

      A snapshot of the values for an entry.

      IMPORTANT: You must only readmetadata or data. Mutating either file can corrupt the disk cache. To modify the contents of those files, use edit.

      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.

      public final class DiskCache.Builder
    • Method Summary

      Modifier and Type Method Description
      abstract DiskCache.Snapshot get(String key) Get the entry associated with key.
      abstract DiskCache.Editor edit(String key) Edit the entry associated with key.
      abstract Boolean remove(String key) Delete the entry referenced by key.
      abstract Unit clear() Delete all entries in the disk cache.
      abstract Long getSize() The current size of the cache in bytes.
      abstract Long getMaxSize() The maximum size of the cache in bytes.
      abstract Path getDirectory() The directory where the cache stores its data.
      abstract FileSystem getFileSystem() The file system that contains the cache's files.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait