-
public final class DiskCache.Builder
-
-
Constructor Summary
Constructors Constructor Description 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 DiskCachebuild()Create a new DiskCache instance. -
-
Method Detail
-
directory
final <ERROR CLASS> directory(Path directory)
-
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.
-
minimumMaxSizeBytes
final <ERROR CLASS> minimumMaxSizeBytes(Long size)
Set the minimum size of the disk cache in bytes. This is ignored if maxSizeBytes is set.
-
maximumMaxSizeBytes
final <ERROR CLASS> maximumMaxSizeBytes(Long size)
Set the maximum size of the disk cache in bytes. This is ignored if maxSizeBytes is set.
-
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.
-
-
-
-