Interface DiskLruCache.DiskFile

Enclosing class:
DiskLruCache

public static interface DiskLruCache.DiskFile
Access to read and write files on a hierarchical data store. Most callers should use the SYSTEM implementation, which uses the host machine's local file system. Alternate implementations may be used to inject faults (for testing) or to transform stored data (to add encryption, for example).

All operations on a file system are racy. For example, guarding a call to source(java.io.File) with exists(java.io.File) does not guarantee that FileNotFoundException will not be thrown. The file may be moved between the two calls!

This interface is less ambitious than FileSystem introduced in Java 7. It lacks important features like file watching, metadata, permissions, and disk space information. In exchange for these limitations, this interface is easier to implement and works on all versions of Java and Android.