FileStorageService

Namespace: WellFired.Guacamole.DataStorage

Implements: WellFired.Guacamole.DataStorage.Types.IDataStorageService

Description

Store textual data in a key/value fashion, key being the file and value the data saved inside. This file is saved a the path indicated in the constructor. The class is thread safe, therefore different instances of FileStorageService can read and write at the same location on different threads.

Properties

string Location { get; set; }

Public Static Methods

void InitializeSharedThreadLock ( IKeyBasedReadWriteLock readWriteLock, bool forceReinitialization = false )

Public Methods

  FileStorageService ( string savingFolder )
string Read ( string key )
void Write ( string data, string key )
void Delete ( string key )
bool Exists ( string key )

Breakdown

  • string Location { get; set; }
  • void InitializeSharedThreadLock ( IKeyBasedReadWriteLock readWriteLock, bool forceReinitialization = false )
  • FileStorageService ( string savingFolder )
  • string Read ( string key )

    Description

    Reads the data that is associated with the given key.

  • void Write ( string data, string key )

    Description

    Write the file key inside Location. If some directories are missing in the path, they are created.

    Parameters

    data
    key
  • void Delete ( string key )

    Description

    Delete the data associated to a given key

  • bool Exists ( string key )

    Description

    Returns true if there is data associated to this key