Share via


StorageManager.SetCacheBehaviorTombstone(File, Boolean) Method

Definition

Enable or disable special cache behavior that leaves deleted cache files intact as tombstones.

[Android.Runtime.Register("setCacheBehaviorTombstone", "(Ljava/io/File;Z)V", "GetSetCacheBehaviorTombstone_Ljava_io_File_ZHandler", ApiSince=26)]
public virtual void SetCacheBehaviorTombstone (Java.IO.File? path, bool tombstone);
[<Android.Runtime.Register("setCacheBehaviorTombstone", "(Ljava/io/File;Z)V", "GetSetCacheBehaviorTombstone_Ljava_io_File_ZHandler", ApiSince=26)>]
abstract member SetCacheBehaviorTombstone : Java.IO.File * bool -> unit
override this.SetCacheBehaviorTombstone : Java.IO.File * bool -> unit

Parameters

path
File
tombstone
Boolean
Attributes

Remarks

Enable or disable special cache behavior that leaves deleted cache files intact as tombstones.

When enabled and a file contained in this directory is automatically deleted by the OS, the file will be truncated to have a length of 0 bytes instead of being fully deleted. This is useful if you need to distinguish between a file that was deleted versus one that never existed.

This behavior can only be set on a directory, and it applies recursively to all contained files and directories. <p class="note"> Note: this behavior is ignored completely if the user explicitly requests that all cached data be cleared.

Java documentation for android.os.storage.StorageManager.setCacheBehaviorTombstone(java.io.File, boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to