class ExceptionPersister
extends java.lang.Object
context.openFileOutput, so no extra permissions are
required since it uses internal storage. See http://developer.android.com/reference/android/content/Context.html#openFileOutput(java.lang.String, int)| Modifier and Type | Field and Description |
|---|---|
private android.content.Context |
context |
(package private) Utils |
utils |
| Constructor and Description |
|---|
ExceptionPersister(android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
closeStream(java.io.Closeable closeable)
Attempt to close given FileInputStream.
|
java.util.Map<java.lang.String,StoredException> |
loadAll()
Load and return all StoredException data.
|
(package private) StoredException |
loadStoredExceptionData(java.lang.String fileName)
Load file by
fileName. |
void |
store(StoredException storedException)
Write given StoredException to a new file.
|
private android.content.Context context
Utils utils
public java.util.Map<java.lang.String,StoredException> loadAll()
StoredException loadStoredExceptionData(java.lang.String fileName)
fileName. This file is expected to contain a StoredException
object that has been converted to json using Gson.
Load the file and convert if from json back to an StoredException object.fileName - File to loadvoid closeStream(java.io.Closeable closeable)
closeable - Input steam to close.public void store(StoredException storedException)
context.openFileOutput so that no extra permissions
are required.
The given StoredException is converted to JSON and then stored as a String.storedException - Exception data to persist.