Class FileLocalDataStore
Stores each Datum as plain-text JSON in a gzip-compressed file on the device's local storage media. Also
supports encryption prior to transmission to a RemoteDataStore.
Inheritance
System.Object
FileLocalDataStore
Assembly: SensusAndroid.dll
Syntax
public class FileLocalDataStore : LocalDataStore, IClearableDataStore
Constructors
FileLocalDataStore()
Declaration
public FileLocalDataStore()
Properties
BufferSizeBytes
Gets or sets the buffer size in bytes. All Probed data will be held in memory until the buffer is filled, at which time
the data will be written to the file. There is not a single-best BufferSizeBytes value. If data are collected at high rates, a
higher value will be best to minimize write operations. If data are collected at low rates, a lower value will be best to minimize the likelihood
of data loss when the app is killed or crashes (as the buffer resides in RAM).
Declaration
[EntryIntegerUiProperty("Buffer Size (Bytes):", true, 2, true)]
public int BufferSizeBytes { get; set; }
Property Value
Type |
Description |
System.Int32 |
The buffer size in bytes.
|
CompressionLevel
Gets or sets the compression level. Options are System.IO.Compression.CompressionLevel.NoCompression (no compression), System.IO.Compression.CompressionLevel.Fastest
(computationally faster but less compression), and System.IO.Compression.CompressionLevel.Optimal (computationally slower but more compression).
Declaration
[ListUiProperty]
public CompressionLevel CompressionLevel { get; set; }
Property Value
Type |
Description |
System.IO.Compression.CompressionLevel |
The compression level.
|
DisplayName
Declaration
public override string DisplayName { get; }
Property Value
Type |
Description |
System.String |
|
Overrides
Encrypt
Whether or not to apply asymmetric-key encryption to data. If this is enabled, then you must either provide a public encryption
key to AsymmetricEncryptionPublicKey or use an authentication server.
You can generate a public encryption key following the instructions provided for
AsymmetricEncryptionPublicKey. Note that data are not encrypted immediately. They are first
written to disk on the device where they live unencrypted for a period of time.
Declaration
[OnOffUiProperty("Encrypt:", true, 6)]
public bool Encrypt { get; set; }
Property Value
Type |
Description |
System.Boolean |
true to encrypt; otherwise, false .
|
HasDataToShare
Declaration
public override bool HasDataToShare { get; }
Property Value
Type |
Description |
System.Boolean |
|
Overrides
SizeDescription
Declaration
public override string SizeDescription { get; }
Property Value
Type |
Description |
System.String |
|
Overrides
StorageDirectory
Declaration
public string StorageDirectory { get; }
Property Value
Type |
Description |
System.String |
|
TotalDataBuffered
Declaration
public long TotalDataBuffered { get; }
Property Value
Type |
Description |
System.Int64 |
|
TotalDataWritten
Declaration
public long TotalDataWritten { get; }
Property Value
Type |
Description |
System.Int64 |
|
TotalDataWrittenToCurrentFile
Declaration
public long TotalDataWrittenToCurrentFile { get; }
Property Value
Type |
Description |
System.Int64 |
|
Methods
Clear()
Declaration
CreateTarFromLocalData(String)
Declaration
public override void CreateTarFromLocalData(string outputPath)
Parameters
Type |
Name |
Description |
System.String |
outputPath |
|
Overrides
Flush()
Declaration
Declaration
protected override bool IsTooLarge()
Returns
Type |
Description |
System.Boolean |
|
Overrides
StartAsync()
Declaration
public override Task StartAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Overrides
StopAsync()
Declaration
public override Task StopAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Overrides
TestHealthAsync(List<AnalyticsTrackedEvent>)
Declaration
public override Task<HealthTestResult> TestHealthAsync(List<AnalyticsTrackedEvent> events)
Parameters
Returns
Overrides
WriteDatum(Datum, CancellationToken)
Declaration
public override void WriteDatum(Datum datum, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
Datum |
datum |
|
System.Threading.CancellationToken |
cancellationToken |
|
Overrides
WriteToRemoteAsync(CancellationToken)
Declaration
public override Task WriteToRemoteAsync(CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Overrides
Implements