public interface FileAccess
Because some storage will need to show auth info to the user before interaction can start, the normal Android lifecycle of Fractivities will need to be modified a bit. In general, code will hit 'onCreate', which will check for live file access, and if there's an issue, show a different UI to the user to resolve. A new part of the lifecycle, onDataReady (or similar) will need to be added. This intended to be run whenever auth is complete, but may happen outside of the standard onCreate/onResume callbacks.
Its assumed that in most cases, once the app has authed, file access should be readily available. If that is NOT the case, for example if a google auth expires, the developer will have to implement an exception case flow. If rare, simply letting the app crash and auth on a restart might be sufficient, but planning for crashes isn't the most elegant of solutions ;)
This is highly volatile at the moment. The interface may change dramatically.
Created by kgalligan on 11/24/15.
Modifier and Type | Method and Description |
---|---|
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.
|
void writeData(android.content.Context context, java.lang.String path, byte[] data)
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.byte[] readData(android.content.Context context, java.lang.String path)
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.void moveData(android.content.Context context, java.lang.String fromPath, java.lang.String toPath)
context
- fromPath
- toPath
- boolean dataExists(android.content.Context context, java.lang.String path)
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.void clearData(android.content.Context context, java.lang.String path)
void setEncrypter(Encrypter encrypter)
encrypter
- Encrypter.