# DeviceProtectedDataStoreFile

Added in 1.2.0

*** ** * ** ***


```
public final class DeviceProtectedDataStoreFile
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 24) https://developer.android.com/reference/androidx/datastore/core/DeviceProtectedDataStoreFile#(android.content.Context).deviceProtectedDataStoreFile(kotlin.String)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html fileName )` Generate the File object for DataStore for use during direct boot. |

## Public methods

### deviceProtectedDataStoreFile

Artifact: [androidx.datastore:datastore-core](https://developer.android.com/jetpack/androidx/releases/datastore) [View Source](https://cs.android.com/search?q=file:androidx/datastore/core/DeviceProtectedDataStoreFile.android.kt+function:deviceProtectedDataStoreFile) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/datastore#1.2.0)

```
@RequiresApi(value = 24)
public static final @NonNull File deviceProtectedDataStoreFile(
    @NonNull Context receiver,
    @NonNull String fileName
)
```

Generate the File object for DataStore for use during direct boot. If the provided context is a user encrypted context, it is converted to a DeviceProtectedStorageContext via `https://developer.android.com/reference/android/content/Context.html#createDeviceProtectedStorageContext()`.

The file is generated by calling `File(deviceProtectedContext.filesDir, "datastore/$fileName")`.

Do NOT use the file outside of DataStore.

The context used to get the files directory @fileName the file name