DataStoreFile
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. |
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 @fileName the file name