public class SimpleFileAccess extends java.lang.Object implements FileAccess
UnencryptedProvider
can be used
to write unencrypted data instead.Constructor and Description |
---|
SimpleFileAccess() |
Modifier and Type | Method and Description |
---|---|
void |
checkPath(java.lang.String path) |
void |
clearData(android.content.Context context,
java.lang.String path) |
boolean |
dataExists(android.content.Context context,
java.lang.String path)
See if we have the data.
|
void |
moveData(android.content.Context context,
java.lang.String fromPath,
java.lang.String toPath) |
byte[] |
readData(android.content.Context context,
java.lang.String path)
Read data.
|
void |
setEncrypter(Encrypter encrypter)
Set the encrypter.
|
void |
writeData(android.content.Context context,
java.lang.String path,
byte[] data)
Save data.
|
@WorkerThread public void writeData(android.content.Context context, java.lang.String path, byte[] data)
FileAccess
writeData
in interface FileAccess
context
- Can be Application context, but we'll be careful not to store, so don't worry too much.path
- Path relative to the implementation's root store. Must start with '/'. No relative paths.data
- Byte array. May implement streams in the future if all implementations support it.@WorkerThread public byte[] readData(android.content.Context context, java.lang.String path)
FileAccess
readData
in interface FileAccess
context
- Can be Application context, but we'll be careful not to store, so don't worry too much.path
- Path relative to the implementation's root store. Must start with '/'. No relative paths.public void moveData(android.content.Context context, java.lang.String fromPath, java.lang.String toPath)
moveData
in interface FileAccess
@WorkerThread public boolean dataExists(android.content.Context context, java.lang.String path)
FileAccess
dataExists
in interface FileAccess
context
- Can be Application context, but we'll be careful not to store, so don't worry too much.path
- Path relative to the implementation's root store. Must start with '/'. No relative paths.public void clearData(android.content.Context context, java.lang.String path)
clearData
in interface FileAccess
public void setEncrypter(Encrypter encrypter)
FileAccess
setEncrypter
in interface FileAccess
encrypter
- Encrypter.public void checkPath(java.lang.String path)