Back to Fresco

DynamicDefaultDiskStorage

docs/javadoc/reference/com/facebook/cache/disk/DynamicDefaultDiskStorage.html

3.6.020.7 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Annotations

Packages | Classes

Summary: Ctors | Methods | Inherited Methods | [Expand All]

public class

DynamicDefaultDiskStorage

extends Object
implements DiskStorage

| java.lang.Object | | ↳ | com.facebook.cache.disk.DynamicDefaultDiskStorage |

Class Overview

A supplier of a DiskStorage concrete implementation.

Summary

Public Constructors
Public Methods
void
Clear all contents of the storage
boolean
Does a resource with this name exist?
DiskStorage.DiskDumpInfo
Collection<DiskStorage.Entry>
Get all entries currently in the storage
BinaryResource
Get the resource with the specified name
String
Get the storage's name, which should be unique
DiskStorage.Inserter
Creates a temporary resource for writing content.
boolean
is this storage enabled?
boolean
is this storage external?
void
long
Remove the resource represented by the entry
long
Remove the resource with specified id
boolean
Does a resource with this name exist? If so, update the last-accessed time for the resource

| [Expand] Inherited Methods | | --- | | From class java.lang.Object

| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

| | From interface com.facebook.cache.disk.DiskStorage

| abstract void | clearAll() Clear all contents of the storage | | abstract boolean | contains(String resourceId, Object debugInfo) Does a resource with this name exist? | | abstract DiskStorage.DiskDumpInfo | getDumpInfo() | | abstract Collection<DiskStorage.Entry> | getEntries() Get all entries currently in the storage | | abstract BinaryResource | getResource(String resourceId, Object debugInfo) Get the resource with the specified name | | abstract String | getStorageName() Get the storage's name, which should be unique | | abstract DiskStorage.Inserter | insert(String resourceId, Object debugInfo) Creates a temporary resource for writing content. | | abstract boolean | isEnabled() is this storage enabled? | | abstract boolean | isExternal() is this storage external? | | abstract void | purgeUnexpectedResources() | | abstract long | remove(DiskStorage.Entry entry) Remove the resource represented by the entry | | abstract long | remove(String resourceId) Remove the resource with specified id | | abstract boolean | touch(String resourceId, Object debugInfo) Does a resource with this name exist? If so, update the last-accessed time for the resource |

|

Public Constructors

public DynamicDefaultDiskStorage(int version, Supplier<File> baseDirectoryPathSupplier, String baseDirectoryName, CacheErrorLogger cacheErrorLogger)

Public Methods

public void clearAll()

Clear all contents of the storage

Throws

| IOException | |

public boolean contains(String resourceId, Object debugInfo)

Does a resource with this name exist?

Parameters

| resourceId | id of the resource | | debugInfo | helper object for debugging |

Returns
  • true, if the resource is present in the storage, false otherwise
Throws

| IOException | |

public DiskStorage.DiskDumpInfo getDumpInfo()

Throws

| IOException | |

public Collection<DiskStorage.Entry> getEntries()

Get all entries currently in the storage

Returns
  • a collection of entries in storage
Throws

| IOException | |

public BinaryResource getResource(String resourceId, Object debugInfo)

Get the resource with the specified name

Parameters

| resourceId | id of the resource | | debugInfo | helper object for debugging |

Returns
  • the resource with the specified name. NULL if not found
Throws

| IOException | |

public String getStorageName()

Get the storage's name, which should be unique

Returns
  • name of the this storage

public DiskStorage.Inserter insert(String resourceId, Object debugInfo)

Creates a temporary resource for writing content. Split from commit() in order to allow concurrent writing of cache entries. This entry will not be available to cache clients until commit() is called passing in the resource returned from this method.

Parameters

| resourceId | id of the resource | | debugInfo | helper object for debugging |

Returns
  • the Inserter object with methods to write data, commit or cancel the insertion
Throws

| IOException | |

public boolean isEnabled()

is this storage enabled?

Returns
  • true, if enabled

public boolean isExternal()

is this storage external?

Returns
  • true, if external

public void purgeUnexpectedResources()

public long remove(DiskStorage.Entry entry)

Remove the resource represented by the entry

Parameters

| entry | entry of the resource to delete |

Returns
  • size of deleted file if successfully deleted, -1 otherwise
Throws

| IOException | |

public long remove(String resourceId)

Remove the resource with specified id

Returns
  • size of deleted file if successfully deleted, -1 otherwise
Throws

| IOException | |

public boolean touch(String resourceId, Object debugInfo)

Does a resource with this name exist? If so, update the last-accessed time for the resource

Parameters

| resourceId | id of the resource | | debugInfo | helper object for debugging |

Returns
  • true, if the resource is present in the storage, false otherwise
Throws

| IOException | |

+Generated by Doclava. +