Package 

Class DiskCache.Builder

    • Method Summary

      Modifier and Type Method Description
      final <ERROR CLASS> directory(File directory) Set the directory where the cache stores its data.
      final <ERROR CLASS> directory(Path directory) Set the directory where the cache stores its data.
      final <ERROR CLASS> fileSystem(FileSystem fileSystem) Set the fileSystem where the cache stores its data, usually FileSystem.SYSTEM.
      final <ERROR CLASS> maxSizePercent(@FloatRange(from = 0.0.toDouble(), to = 1.0.toDouble()) Double percent) Set the maximum size of the disk cache as a percentage of the device's free disk space.
      final <ERROR CLASS> minimumMaxSizeBytes(Long size) Set the minimum size of the disk cache in bytes.
      final <ERROR CLASS> maximumMaxSizeBytes(Long size) Set the maximum size of the disk cache in bytes.
      final <ERROR CLASS> maxSizeBytes(Long size) Set the maximum size of the disk cache in bytes.
      final <ERROR CLASS> cleanupDispatcher(CoroutineDispatcher dispatcher) Set the CoroutineDispatcher that cache size trim operations will be executed on.
      final DiskCache build() Create a new DiskCache instance.
      • Methods inherited from class java.lang.Object

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

      • DiskCache.Builder

        DiskCache.Builder()
    • Method Detail

      • directory

         final <ERROR CLASS> directory(File directory)

        Set the directory where the cache stores its data.

        IMPORTANT: It is an error to have two DiskCache instances active in the same directory at the same time as this can corrupt the disk cache.

      • directory

         final <ERROR CLASS> directory(Path directory)

        Set the directory where the cache stores its data.

        IMPORTANT: It is an error to have two DiskCache instances active in the same directory at the same time as this can corrupt the disk cache.

      • fileSystem

         final <ERROR CLASS> fileSystem(FileSystem fileSystem)

        Set the fileSystem where the cache stores its data, usually FileSystem.SYSTEM.

      • maxSizePercent

         final <ERROR CLASS> maxSizePercent(@FloatRange(from = 0.0.toDouble(), to = 1.0.toDouble()) Double percent)

        Set the maximum size of the disk cache as a percentage of the device's free disk space.

      • maxSizeBytes

         final <ERROR CLASS> maxSizeBytes(Long size)

        Set the maximum size of the disk cache in bytes.

      • cleanupDispatcher

         final <ERROR CLASS> cleanupDispatcher(CoroutineDispatcher dispatcher)

        Set the CoroutineDispatcher that cache size trim operations will be executed on.