C# Class Microsoft.HockeyApp.Services.StorageService

Inheritance: BaseStorageService
Show file Open project: bitstadium/HockeySDK-Windows

Private Properties

Property Type Description
CalculateSizeAsync Task
Delete void
DeleteObsoleteFiles void
EnqueueAsync Task
EnsureSizeIsCalculatedAsync Task
GetFiles IEnumerable
GetSizeAsync Task
Init void
LoadTransmissionFromFileAsync Task
Peek StorageTransmission
SaveTransmissionToFileAsync Task

Private Methods

Method Description
CalculateSizeAsync ( ) : Task

Check the storage limits and return true if they reached. Storage limits are defined by the number of files and the total size on disk.

Delete ( StorageTransmission item ) : void
DeleteObsoleteFiles ( ) : void

Enqueue is saving a transmission to a tmp file and after a successful write operation it renames it to a trn file. A file without a trn extension is ignored by Storage.Peek(), so if a process is taken down before rename happens it will stay on the disk forever. This thread deletes files with the tmp extension that exists on disk for more than 5 minutes.

EnqueueAsync ( Transmission transmission ) : Task
EnsureSizeIsCalculatedAsync ( ) : Task
GetFiles ( CommonFileQuery fileQuery, string filterByExtension, uint top ) : IEnumerable

Get files from storageFolder.

GetSizeAsync ( IStorageFile file ) : Task

Gets a file's size.

Init ( string uniqueFolderName ) : void
LoadTransmissionFromFileAsync ( IStorageFile file ) : Task
Peek ( ) : StorageTransmission

Reads an item from the storage. Order is Last-In-First-Out. When the Transmission is no longer needed (it was either sent or failed with a non-retriable error) it should be disposed.

SaveTransmissionToFileAsync ( Transmission transmission, IStorageFile file ) : Task