FileDataManager class

Stores Datum json objects as plain-text on the device's local storage media. Supports compression (zip) and encryption.

The path and filename format is

carp/data/<study_id>/carp-data-yyyy-mm-dd-hh-mm-ss-ms.json.zip

Inheritance

Constructors

FileDataManager()

Properties

file Future<File>
The current file being written to.
read-only
filename Future<String>
read-only
sink Future<IOSink>
read-only
studyPath Future<String>
Returns the local study path on the device where files can be written.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
study Study
read / write, inherited

Methods

addFileDataManagerListener(FileDataManagerListener listener) → void
close() Future
Close the data manager (e.g. closing connections).
override
flush(File flushFile, IOSink flushSink) → void
Flushes data to the file, compress, encrypt, and close it.
initialize(Study study, Stream<Datum> events) Future
Initialize the data manager by specifying the running Study and the stream of Datum events to handle.
override
notifyAllListeners(FileDataManagerEvent event) Future
onData(Datum datum) → void
On each data event from the data stream, the onData handler is called.
override
onDone() → void
When the data stream closes, the onDone handler is called.
override
onError(dynamic error) → void
When an error event is send on the stream, the onError handler is called.
override
removeFileDataManagerListener(FileDataManagerListener listener) → void
toString() String
Returns a string representation of this object.
override
uploadData(Datum data) Future<bool>
Writes a JSON encoded Datum to the file
jsonEncode(Object object) String
JSON encode an object.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited

Constants

CARP_FILE_PATH → const String
The path to use on the device for storing CARP files.
'carp/data'