StorageDomain.TextFile


public final class StorageDomain.TextFile extends StorageDomain


Targets local raw text files stored within internal app storage.

Summary

Public constructors

TextFile(
    @NonNull String path,
    @NonNull String content,
    boolean isDeviceProtectedStorage
)

Public methods

boolean
equals(Object other)
final @NonNull String

The string content of the file.

final @NonNull String

The path of the file, relative to the app's files directory (Context.getFilesDir()), such as "my_data.txt".

int
final boolean

Whether the file is in device-protected storage, which is available before the user first unlocks the device, rather than in the default storage of the app.

@NonNull String

Public constructors

TextFile

Added in 1.0.0-alpha04
public TextFile(
    @NonNull String path,
    @NonNull String content,
    boolean isDeviceProtectedStorage
)

Public methods

equals

public boolean equals(Object other)

getContent

Added in 1.0.0-alpha04
public final @NonNull String getContent()

The string content of the file.

getPath

Added in 1.0.0-alpha04
public final @NonNull String getPath()

The path of the file, relative to the app's files directory (Context.getFilesDir()), such as "my_data.txt". An absolute path is used as is.

hashCode

public int hashCode()

isDeviceProtectedStorage

Added in 1.0.0-alpha04
public final boolean isDeviceProtectedStorage()

Whether the file is in device-protected storage, which is available before the user first unlocks the device, rather than in the default storage of the app. That is credential-encrypted storage, unless the app sets android:defaultToDeviceProtectedStorage. A relative path then starts at the files directory of device-protected storage.

toString

public @NonNull String toString()