DataStoreFile

Added in 1.0.0

public final class DataStoreFile


Summary

Public methods

static final @NonNull File
dataStoreFile(@NonNull Context receiver, @NonNull String fileName)

Generate the File object for DataStore based on the provided context and name. the file is generated by calling File(context.applicationContext.filesDir, "datastore/$fileName").

Public methods

dataStoreFile

public static final @NonNull File dataStoreFile(@NonNull Context receiver, @NonNull String fileName)

Generate the File object for DataStore based on the provided context and name. the file is generated by calling File(context.applicationContext.filesDir, "datastore/$fileName"). This is public to allow for testing and backwards compatibility (e.g. if moving from the dataStore delegate or context.createDataStore to DataStoreFactory).

Do NOT use the file outside of DataStore.

the context of the application used to get the files directory

the file name