public final class CrashReportPersister
extends java.lang.Object
ReportField
enum values as keys.
This is basically the source of Properties
adapted to extend an
EnumMap instead of Hashtable and with a few tweaks to avoid losing crazy
amounts of android time in the generation of a date comment when storing to
file.Constructor and Description |
---|
CrashReportPersister() |
Modifier and Type | Method and Description |
---|---|
CrashReportData |
load(java.io.File file)
Loads properties from the specified
File . |
void |
store(CrashReportData crashData,
java.io.File file)
Stores the mappings in this Properties to the specified OutputStream,
putting the specified comment at the beginning.
|
@NonNull public CrashReportData load(@NonNull java.io.File file) throws java.io.IOException, org.json.JSONException
File
.file
- Report file from which to load the CrashData.java.io.IOException
- if error occurs during reading from the File
.org.json.JSONException
- if the stream cannot be parsed as a JSON object.public void store(@NonNull CrashReportData crashData, @NonNull java.io.File file) throws java.io.IOException
crashData
- CrashReportData to save.file
- File into which to store the CrashReportData.java.io.IOException
- if the CrashReportData could not be written to the OutputStream.